<div dir="ltr"><div dir="ltr">On Wed, Feb 23, 2022 at 3:40 PM Ulrich Windl <<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-regensburg.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
I think there was a recent discussion saying that no unit should Want= or Require= a target, but only use them for ordering.<br>
I have basically three questions:<br>
<br>
1) Is the statement above correct?<br></blockquote><div><br></div><div>Not for all targets in general. It may be correct for some .targets but not others, and for some services but not others, but something *does* need to pull the target in as a dependency, otherwise it would never be started – there's (almost) nothing special in ordering against targets, After=foo.target only waits for foo.target to become "started" like for other unit types.</div><div><br></div><div>Some of the systemd-provided targets differ in whether the "provider" vs "consumer" should Want them. For example, systemd.special(7) says that Wants=network.target should go in the network provider (so other services only need an After), while Wants=network-online.target would go in the "consumer" service that wants to *wait* for network (as the target itself has dependencies that shouldn't be started unless needed).</div><div><br></div><div>For some targets, "Wants or no Wants" follows the same rules as for services – e.g. tinc VPN became multi-instance and got a .target to cover all instances, so if you previously wouldn't have used Wants=tinc.service but only After, then the same applies to the new .target as well.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
2) When is a target displayed as "started" by sysctemctl status then?<br></blockquote><div><br></div><div>When it gets started.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
3: Which of the following (form current SLES12 SP5, grep-style) are wrong?:<br>
<br>
/usr/lib/systemd/system/ntpd.service:Wants=network.target<br>
/usr/lib/systemd/system/ntpd.service:After=network.target<br>
<br>
/usr/lib/systemd/system/nfs-server.service:Requires= network.target proc-fs-nfsd.mount<br>
/usr/lib/systemd/system/nfs-server.service:After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service<br>
<br>
/usr/lib/systemd/system/nmb.service:After=network.target<br></blockquote><div><br></div><div>According to docs for network.target, it's the first two that are "wrong".</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>