[systemd-devel] need help implementing a special behaviour

Steffen Sledz sledz at dresearch-fe.de
Tue Jul 8 05:11:25 PDT 2014


On 08.07.2014 13:53, Lennart Poettering wrote:
> On Tue, 23.07.13 08:05, Steffen Sledz (sledz at dresearch-fe.de) wrote:
>> ... 
>> But we found no way to guarantee that *all* services of the formerly
>> active operation mode (except the ones which should run in the new
>> mode too) are *completely terminated* before the services of the new
>> mode *begin to start*.
> 
> This is not available as global switch. You'd have to order the units
> individually against each other, with After= or Before=.
> 
> Note that After= and Before= would actually have the *same* effect here,
> as the general rule how they are executed is like this:
> 
>    With two units, A and B where B has After=A set:
> 
>    1) If the two units are started up, then B is started after A.
> 
>    2) If the two units are shut down, then A is stopped after B. (The rule
>    is: the shutdown order is the inverse of the startup order).
> 
>    3) If A is stopped, and B is started, then A is stopped first, and then
>    B is started.
> 
>    4) If B is stopped, and A is started, then A is also stopped first, and
>    then B is started. (The rule is: when two units are ordered against
>    each other, and one is started the other stopped, then the stop is
>    *always* executed before the start, regardless in which way they are
>    ordered).
> 
> But yeah, I can see that you are look for a simple global option here,
> but this doesn't exist, and I am not sure how we could implement that. 

Thanx for this clarification.

There is one more open question. We did not found a *clear* definition (e.g. a state diagram) of all the states a unit can have.

e.g. What is the criteria for a service to change from *activating* to *active/started*?

Regards,
Steffen

PS: Sorry for the overlapping request with my colleague.

-- 
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:sledz at dresearch-fe.de
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058


More information about the systemd-devel mailing list