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

Andrei Borzenkov arvidjaar at gmail.com
Sun Dec 7 03:39:56 PST 2014


В Sun, 7 Dec 2014 09:39:50 +0200
Martin Pitt <martin.pitt at ubuntu.com> пишет:

> 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.
> 

I think systemctl enable|disable should always create respective links
in /etc. It makes it obvious that this is admin decision. It also makes
implementation easier. And systemctl reset (or equiv.) would simply
delete any link in /etc thus reverting to (distribution) defaults
in /usr.

> > 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



More information about the systemd-devel mailing list