<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:lennart@poettering.net" title="Lennart Poettering <lennart@poettering.net>"> <span class="fn">Lennart Poettering</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - Required units are not started in certain setups"
href="https://bugs.freedesktop.org/show_bug.cgi?id=85746">bug 85746</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>WONTFIX
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - Required units are not started in certain setups"
href="https://bugs.freedesktop.org/show_bug.cgi?id=85746#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - Required units are not started in certain setups"
href="https://bugs.freedesktop.org/show_bug.cgi?id=85746">bug 85746</a>
from <span class="vcard"><a class="email" href="mailto:lennart@poettering.net" title="Lennart Poettering <lennart@poettering.net>"> <span class="fn">Lennart Poettering</span></a>
</span></b>
<pre>systemd's dependency logic is fully parallel, and it will dispatch and complete
jobs as early as possible (i.e. eagerly), looking at them individually and
independently of anything else. With a setup like yours, if D.device appears,
then this is all systemd was asked to wait for, and it will complete the job
waiting for it so that this dependency for S1 is fulfilled. The fact that D
goes away immediately afterwards is not relevant for this case.
Also not the distinction between Requires= and BindTo=. Requires= just means
that the the start job of some other unit has to have completed successfully,
and if it didn#t any start job for your unit would fail too. The start job of
units doesn't necessarily result in a unit being active though. For example,
all services of type=oneshot and RemainAfterExit=no generally go from
activating directly into inactive, with the start job being completed
sucessfully. Now, BindTo= is like Requires= but it has one additional effect:
when the specified other unit goes down, your unit will be pulled down too
again, it's hence not only about starting, but also about stopping.
That said, BindTo= is not going to make you happy either I fear, since it#s not
really useful here, because things will be executed in parallel, and hence the
effect of BindTo= pulling your service down is likely to hit your service at a
time where it already started up and failed.
My suggestion for a workaround would be to readd the D.device job a second
time, from s2.service. if the loop device showed up for the the first time, the
D.device is properly completed by systemd. However, after removing the device
again you enqueue the job a second time, so that it needs to be processed by
systemd a second time. For this, you could add ExecStart=/usr/bin/systemctl
start --no-block dev-loop0.device from s2.service, after the two losetup
commands...
Anyway, other than this work-around I cannot suggest much. The state engine
tries to eagerly process jobs, to make things as quick as possible, and it is
simply not compatible with what you are trying to do. Sorry!</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>