[systemd-devel] [RFC] Preset Files

Lennart Poettering lennart at poettering.net
Wed Jul 6 07:25:15 PDT 2011


On Wed, 06.07.11 01:07, Marius Tolzmann (tolzmann at molgen.mpg.de) wrote:

> 
> On 06.07.2011 00:51, Kay Sievers wrote:
> >On Wed, Jul 6, 2011 at 00:42, Lennart Poettering<lennart at poettering.net>  wrote:
> >>>
> >>>We will require an argument. There will no 'change all services'
> >>>logic.
> >>
> >>Uh?
> >>
> >>Actually, I do want a way how people can reset all service enable states
> >>to what the vendor intended. And that should be "systemctl preset"
> >>without arguments I believe.
> >
> >That sounds pretty scary, it would usually just enable all installed
> >services. This probably causes trouble with things like syslogs and
> >login-managers that might be installed but only one of them should be
> >enabled at the time. Not sure how that should really work.
> 
> But they will be enabled anyway after installation if no 'disable
> login-manager.service' or 'disable *' is listed in any preset file
> and systemctl preset <unit> is run?
> 
> i am just afraid that someday 'systemctl preset' will break my setup
> even if a havn't defined 'enable/disable *' anywhere.

Yes, it's a dangerous tool, but I think the right approach to make it
less dangerous is adding a number of security precautions here. For
example, we could say that when you rung "systemctl reset" without
further args this would just tell you what it would do, but not actually
do it. If you then add --force it will actually do it. Or we could alter
this a bit and use "all" as special argument for this logic, so that the
user explicitly has to tell us that presetting everything is really
really what he wants.

Also note that we should boot without problems even with all units
disabled, since the really really crucial services are enabled via
symlinks in /lib, instead of /etc. So it's not super-dangerous, but just
a bit dangerous.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list