[systemd-devel] Why do stop jobs run asynchronously on "systemctl isolate target"?

Lennart Poettering lennart at poettering.net
Mon Mar 25 09:58:24 PDT 2013


On Mon, 25.03.13 09:54, Umut Tezduyar (umut at tezduyar.com) wrote:

> Hi,
> 
> Lets talk on an example. Say we have a target, A.target,  that has 100
> services starting up and B.target which has only 1 service to start out of
> 100 services that have been started by A.target. When switching from
> A.target to B.target, "systemctl isolate B.target" will return immediately,
> "systemctl is-active B.target" will tell is-active immediately. But, I
> think switching hasn't been completed since 99 services that are started by
> A.target are being stopped in the background. My thought is, B.target is
> NOT active until all the services are started and all the services are
> stopped.
> 
> Do we need to add After=, Before= to all 99 services against B.target? Is
> there a better way? Ex: "systemctl isolate B.target --wait-for-stop-jobs"

I can see how that would be nasty...

Hmm, I need to think about this one. What you basically want here is an
implicit dependency that exists only during the isolation transaction
but not necessarily normally... Grr, the curernt model doesn't allow
that.

Michal, do you have any ideas on this one?

(For now I added this to the TODO list. This is something to think
about, but I don't have a good idea what we can do about it...)

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list