<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Отправлено с iPhone</div><div><br>1 сент. 2015 г., в 21:39, Nekrasov, Alexander <<a href="mailto:alexander.nekrasov@emc.com">alexander.nekrasov@emc.com</a>> написал(а):<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta name="Generator" content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:440607310;
mso-list-type:hybrid;
mso-list-template-ids:-1376904924 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--><div class="WordSection1"><p class="MsoNormal">Take the following structure:<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><u>A.service:<o:p></o:p></u></p><p class="MsoNormal">Requires=base.service<o:p></o:p></p><p class="MsoNormal">Type=fork<o:p></o:p></p><p class="MsoNormal">Restarts=no<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><u>B.service:<o:p></o:p></u></p><p class="MsoNormal">Requires=base.service<o:p></o:p></p><p class="MsoNormal">Type=fork<o:p></o:p></p><p class="MsoNormal">Restarts=no<o:p></o:p></p><p class="MsoNormal">After=A<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">C.service:<o:p></o:p></p><p class="MsoNormal">Requires=base.service<o:p></o:p></p><p class="MsoNormal">Type=fork<o:p></o:p></p><p class="MsoNormal">Restarts=no<o:p></o:p></p><p class="MsoNormal">After=B<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><u>Up.target:<o:p></o:p></u></p><p class="MsoNormal">Requires=A B C<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Normally, <i>systemctl start up.target</i> brings up base, A, B, C, in the correct order. Similarly, <i>systemctl stop base.service</i> brings down C B A, in correct order. All is well.<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span style="mso-list:Ignore">1)<span style="font:7.0pt "Times New Roman""> </span></span><!--[endif]-->If A or B fails to start (return 1 from ExecStart), they assume <i>Active: failed </i>state, but the stack continues to start regardless. I expected that Requires= would mean that up.target would stop and start-up would be interrupted. </p></div></div></blockquote><div><br></div><div>There is no Requires dependency between A, B and C. So up.target will fail (because one of required units failed) but it does not affect what happens to A, B or C.</div><div><br></div><br><blockquote type="cite"><div><div class="WordSection1"><p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1">How can I achieve that? </p></div></div></blockquote><div><br></div><div>If B requires A it has to say so.</div><br><blockquote type="cite"><div><div class="WordSection1"><p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1">Adding up.target::Requisite=A B C doesn’t change anything.<o:p></o:p></p><p class="MsoListParagraph" style="margin-left:1.0in"><o:p> </o:p></p><p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1"><!--[if !supportLists]--><span style="mso-list:Ignore">a.<span style="font:7.0pt "Times New Roman""> </span></span><!--[endif]-->This is a simplified example. In reality I have tens of components that only know their immediate dependency, but not the whole chain. Adding explicit C::Requires=B would solve this for when B fails, but imagine there’s an F::After=E where F must not Require=E (i.e., F must not stop if E fails), then such F will start even if B failed to start. So I would have to add a F::Requires=B, and propagate that through the entire stack. And then do the same to A and C, etc. Doesn’t seem very scalable or flexible. <o:p></o:p></p><p class="MsoListParagraph"><o:p> </o:p></p><p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span style="mso-list:Ignore">2)<span style="font:7.0pt "Times New Roman""> </span></span><!--[endif]-->If b fails, and then later I stop the base service, shutdown is out of order. C and A stop in parallel, or even C stops after A. It seems like breaking the chain anywhere in the stack breaks the dependency tree at least in that place. In other words, ordering C->B->A doesn’t mean translate into C->A if B fails before stopping is initiated. How can I fix that?</p></div></div></blockquote><div><br></div><div>If C can start without B being present it is logical to assume that it does not need anything before B. If C Required B, described situation would not be possible at all.</div><div><br></div><br><blockquote type="cite"><div><div class="WordSection1"><p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Thanks,<o:p></o:p></p><p class="MsoNormal">Alex<o:p></o:p></p></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>systemd-devel mailing list</span><br><span><a href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.freedesktop.org</a></span><br><span><a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a></span><br></div></blockquote></body></html>