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

Tobias Geerinckx-Rice tobias.geerinckx.rice at gmail.com
Sun Sep 21 22:31:51 PDT 2014


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


More information about the systemd-devel mailing list