[systemd-devel] Support for staged startup

Umut Tezduyar Lindskog umut at tezduyar.com
Fri Jan 30 01:15:40 PST 2015


Hi,

What you have figured out is so far the only way if you want to have
dynamic targets.
If you do not use "--no-block" to start your second target, first
target will never finish.
Other caveat of your way is that systemd doesn't know about your final
target until it receives "systemctl start destination.target". Since
it doesn't know about the target, units that are requested by
destination.target will not have the default dependencies applied.

For example, if your destination target WANTS hello.socket (which has
DefaultDependencies=yes), hello.socket will not be started before
socket.target.

Umut


On Fri, Jan 30, 2015 at 7:06 AM, Hoyer, Marko (ADITG/SW2)
<mhoyer at de.adit-jv.com> wrote:
> Hi Alison,
>
>> -----Original Message-----
>> From: Alison Chaiken [mailto:alison at she-devel.com]
>> Sent: Thursday, January 29, 2015 8:17 PM
>> To: systemd-devel at lists.freedesktop.org
>> Cc: Hoyer, Marko (ADITG/SW2)
>> Subject: Re: Support for staged startup
>>
>> Marko Hoyer asks:
>> > I'd like to realize a staged startup with systemd which is mainly
>> about:
>> > - starting up a static tree up to a final service
>> > - the only job of the final service is to kick off the start of an
>> > additional sub tree of units This kind of startup could be realized
>> > simply by adding an additional one shot service which executes:
>> > systemctl start xxx.target
>>
>> Marko, one target can already be specified as "After" another.   If
>> B.target is present in one of the appropriate directories and specifies
>>
>> After=A.target
>>
>> and all the services of the final sub-tree are symlinked in a
>> B.target.wants directory, doesn't the behavior you need result?   What
>> is  missing?    Of course, some of the units linked in B.target.wants
>> may already be started by the time A.target completes if they are part
>> of a earlier target or if they are needed by an earlier unit.   To
>> suppress that behavior, you'd have to edit the individual units.
>>
>> I don't know of any use case for one unit to start another directly.
>> Is there one?
>
> 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.
>
>>
>> -- 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
>
> Best regards
>
> Marko Hoyer
> Software Group II (ADITG/SW2)
>
> Tel. +49 5121 49 6948
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list