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

Martin Pitt martin.pitt at ubuntu.com
Sat Dec 6 23:39:50 PST 2014


Hello all,

sorry for the late response.

Andrei Borzenkov [2014-12-05 10:58 +0300]:
> That's not how I actually understood it. enable/disable still applies
> only to units with [Install] section as it is now. Just that

Correct. I don't see any need to change the behaviour of static units,
and I don't want to change the "visible effect" of systemctl/disable,
nor the current semantics of changing wants/ symlinks in /etc.

> unit foo.service is disabled if
> [...[
> 2. There are no links from [Install] in /usr/lib or /etc *OR* there are
> links in /usr/lib which are masked in /etc.

Indeed the part after the "OR" is the only change that I propose. I. e.

 - systemctl enable: If /usr/.../wants/foo.service exists, remove the
   /dev/null symlink in /etc/.../wants/foo.service if it exists (if
   not, it's already enabled). Otherwise, behave as now.

 - systemctl disable: If /usr/.../wants/foo.service exists, create a
   /dev/null symlink in /etc/.../wants/foo.service if it doesn't exist
   yet (if it does, it's already disabled). Otherwise, behave as now.

> This will allow to cleanly separate distribution default (/usr/lib) and
> admin decision (/etc). Also this will allow systemctl list-unit-files to
> supply information like
> 
> enabled (default)/enabled (admin)
> 
> depending on whether link in /usr/lib or /etc exists.

Exactly.

Thanks,

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