[systemd-devel] /usr vs /etc for default distro units enablement

Martin Pitt martin.pitt at ubuntu.com
Sat Dec 6 23:26:00 PST 2014


Lennart Poettering [2014-12-05 14:52 +0100]:
> To be honest I find the entire stuff with ENABLED=true/false really
> questionnable, I think it would be agreat step ahead to get rid of
> it. (But then again, I cannot make Debian's decisions there...)

Indeed it is. It has never really been necessary, as all init systems
have their canonical way of disabling/enabling things: SysV with the
/etc/rc?.d/ symlinks, systemd with the wants/ symlinks, upstart with
empty .override files. And Debian even has a script "update-rc.d
enable|disable foo" which does that for all init systems. So the
ENABLED in /etc/default/foo has always been entirely redundant and
confusing. Fortunately it isn't that widespread, but some packages
need to be cleaned up there.

Anyway, quite a far disgression into distro specific oddities now. :-)

> > Only preinst can (getting the "install" or "upgrade" argument), not postinst
> > (getting "configure" in both case). And we need to run the preset/enable in
> > postinst (meaning: after unpacking).
> 
> This sounds quite a limitation. Maybe you can keep a couple of touch files
> in /var/lib/ somewhere where you store whether you already applied
> "systemctl preset" before?

It's not a limitation, the postinst *can* differ between initial
install and upgrade by looking at $2 (the "most recently configured
version"). If it's empty, it's a new install.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the systemd-devel mailing list