<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 2, 2015 at 1:24 PM, Frank Steiner <span dir="ltr"><<a href="mailto:fsteiner-mail1@bio.ifi.lmu.de" target="_blank">fsteiner-mail1@bio.ifi.lmu.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
for our diskless clients I setup the network and the root fs in the<br>
kernel/initrd and do two additional mounts in the initrd which are<br>
specific for every client.<br>
<br>
I understand the boot concept with its dependencies and ordering but I've<br>
no idea how to influence the shutdown process in two ways:<br>
<br>
1. I want to keep the network running. To avoid problems with dependencies<br>
I had to keep it enabled although all the stuff is done in the kernel/initrd.<br>
Thus, it shuts down during reboot and the diskless client hangs of course.<br>
<br>
Changing the ExecStop to /usr/bin/true does work, but I wonder if there<br>
is a better way in general to remove a process from the shutdown tree.<br>
In SysV I just did "inserv -r network" in halt.local so that the shutdown<br>
link was removed before it would be considered.<br>
<br>
Is there something similar for systemd? "systemctl disable network"<br>
didn't work.<br></blockquote><div><br></div><div>No. Being an actual service manager, systemd keeps track _internally_ of which services are active at any moment. Filesystem changes won't affect that. (Messing around with service state was a bad idea in general, even with sysvinit.)</div><div><br></div><div>If the 'main' network.service doesn't do anything anyway (since the network is already up), you can replace it entirely with Type=oneshot, ExecStart=/bin/true, RemainAfterExit=yes, essentially a service that does nothing at all (but still satisfies dependencies).</div><div><br></div><div>(If you _actually_ meant "remove a process" instead of "remove a service", then yes, there are some other methods, such as KillMethod= or the "@" prefix [2]. But that isn't of much use for NFS, I think.)</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
2. The two additional NFS mounts should be kept active, too. There are no<br>
*.mount files for them in /run/systemd/generator, because they are<br>
mounted in the initrd I guess.<br></blockquote><div><br></div><div>Not sure about this one. I wonder if the "shutdown initramfs" feature [1] would help here.</div><div><br></div><div>[1]: <a href="http://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/">http://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/</a></div><div>[2]: <a href="http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/">http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/</a></div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div></div>
</div></div>