[systemd-devel] Support for staged startup

Alison Chaiken alison at she-devel.com
Sat Jan 31 09:09:03 PST 2015


I asked:
>> I don't know of any use case for one unit to start another directly.
>> Is there one?

Marko responds:
> 1.) Coming up with a small tree first reduces the loading time of the unit set (not so much important in my case)
>
> 2.) If you wanna create some dynamics between target A and target B so that depending on the startup situation services are already started before A or in another round they are delayed until A is done, you probably need to disconnect them from the static startup tree and pull them in dynamically at the desired time.

systemd includes 19 conditionals (see './systemd
--dump-configuration-items | grep Cond').    The first, static set of
services can therefore use a variety of signals like symlinks or file
modification times to signal the second wave of services.    You
could, for example, write a script to dynamically change where
default.target points depending on whether ConditionKernelCommandLine
contains certain bootargs or ConditionFirstBoot is TRUE.   These
signals are in addition to the more usual ones implemented by
sd_notify().

If there's a real need to check a different type of Condition, it
would be more in keeping with the spirit of systemd to add the new
Condition functionality than to have one unit specifically invoke
another.

-- Alison

-- 
Alison Chaiken                           alison at she-devel.com
650-279-5600
http://{she-devel.com,exerciseforthereader.org}
Never underestimate the cleverness of advertisers, or mischief makers,
or criminals.  -- Don Norman


More information about the systemd-devel mailing list