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

Mantas Mikulėnas grawity at gmail.com
Mon Sep 22 06:36:21 PDT 2014


On Sep 22, 2014 4:07 PM, "Tobias Geerinckx-Rice" <
tobias.geerinckx.rice at gmail.com> wrote:
>
> On 22 September 2014 07:57, Alexander Groleau <awgneo at xbetanet.com> wrote:
> > I have tried the following script as well during my adventures with no
> > success:
> >
> > [Unit]
> > Description=Start/Stop Libvirt Windows Guest
> > Documentation=man:libvirtd(8)
> > Documentation=http://libvirt.org
> > After=libvirtd.service
>
> Manually ordering services with Before=/After= is usually a mistake.
> Try using Requires= or BindTo= instead, and let systemd handle
> ordering for you.

Neither Requires nor BindsTo imply any ordering though. So that might in
fact *create* race conditions, if both A and B start at once, but A already
expects B to be available.

>
> > [Service]
> > ExecStart=/usr/bin/libvirt-windows.sh start
> > ExecStop=/usr/bin/libvirt-windows.sh stop
> > RemainAfterExit=yes
> > Type=oneshot
> > StandardOutput=journal+console
> >
> > [Install]
> > WantedBy=multi-user.target
> >
> > This works for boot (my sh script is run right after libvirtd is
started);
> > however, the libvirtd daemon, started by libvirtd.service, is always
> > terminated well before my sh is run on shutdown/reboot.
>
> I can't see any other obvious problems. This should just work, unless
> something other than systemd is killing your libvirtd.
>
> Regards,
>
> T G-R
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140922/93c4ad03/attachment.html>


More information about the systemd-devel mailing list