[systemd-devel] Cannot get Shutdown Script to Run (Libvirt Virtual Machine Shutdown)

Alexander Groleau awgneo at xbetanet.com
Sun Sep 21 22:38:09 PDT 2014


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.

What might I try to use for the WantedBy instead? I thought
DefaultDependencies=no
removed the standard conflict with shutdown.target.

Thanks for your response. Any other suggestions? :)

On Mon, Sep 22, 2014 at 1:31 AM, Tobias Geerinckx-Rice <
tobias.geerinckx.rice at gmail.com> wrote:

> On 22 September 2014 05:40, Alexander Groleau <awgneo at xbetanet.com> wrote:
> > Hello systemd users,
>
> Oh good. That's me!
>
> > I have been trying desperately for weeks to get my simple shutdown script
> > for a Libvirt guest to run before libvirtd is shut down, without success.
> > Essentially, I need the libvirt-windows.sh script to run before the
> libvirtd
> > service is terminated (which occurs right after systemd-logind outputs
> its
> > reboot message). How can I get my script into this initial section of
> daemon
> > shutdowns, at the top?
>
> "Weeks" makes one hesitant to ask: have you tried just popping a
>
>   ExecStop=/usr/bin/libvirt-windows.sh stop
>
> snippet into /etc/systemd/system/<my.libvirt.service>.d/?
>
> > [Install]
> > WantedBy=shutdown.target
>
> Either way, shutdown.target "conflicts with all system services" [1],
> and is probably not what you want.
>
> Good luck,
>
> T G-R
>
> [1]
> http://www.freedesktop.org/software/systemd/man/bootup.html#System%20Manager%20Shutdown
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140922/c734ca2d/attachment.html>


More information about the systemd-devel mailing list