[systemd-devel] [RFC] Preset Files

Marius Tolzmann tolzmann at molgen.mpg.de
Wed Jul 6 08:56:38 PDT 2011


hi..


On 07/06/11 16:25, Lennart Poettering wrote:
> On Wed, 06.07.11 01:07, Marius Tolzmann (tolzmann at molgen.mpg.de) wrote:
> 
>> 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.

don' get me wrong.. i like the idea of "systemctl preset without args"
will restore a *configured* default setting..

but i would prefer a behavior where it only would restore a default
setting that is configured explicitly.

so i prefer something like this for the "systemctl preset without args"
case:

for every unit $u do
   $state = get_unit_preset $u
   if $state==unconfigured => continue loop
   set unit to state to $state
done

(state := enabled | disabled | unconfigured)

instead of something like that:

for every unit $u do
   $state = get_unit_preset $u
   if $state==unconfigured => $state=enable
   set unit to state to $state
done

...so if "disable/enable *" is explicitly configured... do it..
and if a service does not match any rule.. just keep the current state..

"systemctl preset <unit>" may still enable the unit by default if not
configured.. this won't break my system setup.. 8)

at work i am currently the only one who cares about systemd but not the
only one with root access...  but i will be the one to blame if
something breaks: "hey, i tried your systemd-thing and entered
'systemctl preset'... now everything is started by default.. i don't
like it.. fix it.. it's your systemd... you are the only one who likes
it.. hrhr.." ..

8)

i will probably end up writing a script creating presets for the
different hosts and updating those presets every time something
changes.. wouldn't be that hard.. but it is different to just ssh-ing to
host X and enable/disable service y...

no matter what... presets are a great idea 8)

--force or keyword "all" is also a better approach than "without args"..
so i could blame my co-roots for being "stupid and ugly" and just go home 8)


bye marius..


-- 
Dipl.-Inf. Marius Tolzmann <marius.tolzmann at molgen.mpg.de>
----------------------------------.------------------------------
MPI f. molekulare Genetik         |
Ihnestrasse 63-73, D-14195 Berlin |   ==> MarIuX GNU/Linux <==
Phone: +49 (0)30 8413 1709        |
----------------------------------^------------------------------
God put me on earth to accomplish a certain number of things.
Right now I am so far behind..
   ..I will never die.         <by calvin from calvin&hobbes ;)>


More information about the systemd-devel mailing list