<div dir="ltr">Hi,<div><br></div><div style>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.</div>
<div style><br></div><div style>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"</div><div style><br></div><div style>
I am using "systemctl list-jobs" to ensure that all the stop jobs are also completed.</div><div style><br></div><div style>Thanks</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 23, 2013 at 3:43 AM, Lennart Poettering <span dir="ltr"><<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, 08.03.13 14:38, Umut Tezduyar (<a href="mailto:umut@tezduyar.com">umut@tezduyar.com</a>) wrote:<br>
<br>
> Hi,<br>
><br>
> I have realized that return of "systemctl isolate <target>" command is only<br>
> synchronous for "starting" jobs but not for "stopping" jobs. How can<br>
> one<br>
<br>
</div>Well, it is synchronous to jobs that are ordered against the unit you<br>
isolate, this isn't any different from any other unit ordering...<br>
<br>
You might simply need to add an After= or Before= dependency?<br>
<br>
Not that when a unit is started and another one is stopped and they are<br>
ordered against each other, the one to be stopped is first stopped,<br>
before the one to be started is started, regardless whether After= or<br>
Before= was used. Or in other words: the difference between After= and<br>
Before= only has an effect on the order of two jobs that are started,<br>
or two jobs that are stopped, but not on two jobs where one is started<br>
and the other is stopped.<br>
<span class="HOEnZb"><font color="#888888"><br>
Lennart<br>
<br>
--<br>
Lennart Poettering - Red Hat, Inc.<br>
</font></span></blockquote></div><br></div>