<div dir="ltr">I have tried the traditional ExecStart, ExecStop all in one script with no luck (with RemainAfterExit=yes, etc.). I just can't seem to get it to run in this daemon SIGTERM section :(. I hate how on my system, libvirtd is literally the first thing to go down, making this quite tricky.<div><br></div><div>What might I try to use for the WantedBy instead? I thought <span style="font-family:arial,sans-serif;font-size:13px">DefaultDependencies=no removed the standard conflict with shutdown.target.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Thanks for your response. Any other suggestions? :)</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 22, 2014 at 1:31 AM, Tobias Geerinckx-Rice <span dir="ltr"><<a href="mailto:tobias.geerinckx.rice@gmail.com" target="_blank">tobias.geerinckx.rice@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 22 September 2014 05:40, Alexander Groleau <<a href="mailto:awgneo@xbetanet.com">awgneo@xbetanet.com</a>> wrote:<br>
> Hello systemd users,<br>
<br>
Oh good. That's me!<br>
<span class=""><br>
> I have been trying desperately for weeks to get my simple shutdown script<br>
> for a Libvirt guest to run before libvirtd is shut down, without success.<br>
> Essentially, I need the libvirt-windows.sh script to run before the libvirtd<br>
> service is terminated (which occurs right after systemd-logind outputs its<br>
> reboot message). How can I get my script into this initial section of daemon<br>
> shutdowns, at the top?<br>
<br>
</span>"Weeks" makes one hesitant to ask: have you tried just popping a<br>
<br>
  ExecStop=/usr/bin/libvirt-windows.sh stop<br>
<br>
snippet into /etc/systemd/system/<my.libvirt.service>.d/?<br>
<br>
> [Install]<br>
> WantedBy=shutdown.target<br>
<br>
Either way, shutdown.target "conflicts with all system services" [1],<br>
and is probably not what you want.<br>
<br>
Good luck,<br>
<br>
T G-R<br>
<br>
[1] <a href="http://www.freedesktop.org/software/systemd/man/bootup.html#System%20Manager%20Shutdown" target="_blank">http://www.freedesktop.org/software/systemd/man/bootup.html#System%20Manager%20Shutdown</a><br>
</blockquote></div><br></div>