libvirt/tools
Gerd v. Egidy 79ca7e4e57 libvirt-guests: systemd host shutdown does not work
I originally postet this into the Fedora bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=843836

Currently gracefully shutting down guest vms on host shutdown does not work on
Fedora 17, the guests are killed hard on system shutdown.

The reason is systemd considers libvirt-guests.service to be stopped when the
system is running:

$ systemctl status libvirt-guests.service
libvirt-guests.service - Suspend Active Libvirt Guests
          Loaded: loaded (/usr/lib/systemd/system/libvirt-guests.service;
enabled)
          Active: deactivating (stop) since Fri, 27 Jul 2012 15:47:31 +0200;
2min 48s ago
         Process: 1085 ExecStart=/etc/init.d/libvirt-guests start
(code=exited, status=0/SUCCESS)
         Control: 1150 (libvirt-guests)
          CGroup: name=systemd:/system/libvirt-guests.service
                  └ control
                    ├ 1150 /bin/sh /etc/init.d/libvirt-guests stop
                    └ 2257 sleep 1

libvirt-guests.service is defined as type "simple" in systemd (the default).
That means systemd will shut down the service when the start executable is
terminated after starting is done. Systemd will not call stop again on system
shutdown because it thinks it is already stopped.

The solution is to define it as type "oneshot" and set the flag
"RemainAfterExit". Then systemd will consider the service as active after
startup and will call the stop function on host shutdown.
2012-07-27 09:31:52 -06:00
..
console.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
console.h Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
libvirt_win_icon_16x16.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_32x32.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_48x48.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_64x64.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt-guests.init.sh libvirt-guests: Remove LISTFILE if it's empty when stopping service 2012-05-15 16:22:28 +08:00
libvirt-guests.service.in libvirt-guests: systemd host shutdown does not work 2012-07-27 09:31:52 -06:00
libvirt-guests.sysconf libvirt-guests: Add parallel startup and shutdown of guests 2012-03-05 13:18:24 +01:00
Makefile.am Fixup manpage names and copyright dates 2012-07-25 12:46:29 -04:00
virsh_win_icon.rc Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
virsh-domain-monitor.c virsh: Fix error resetting on fallback paths 2012-07-27 10:34:58 +02:00
virsh-domain.c virsh: Refactor error clearing on graceful fallback paths 2012-07-27 10:28:22 +02:00
virsh-edit.c maint: Use consistent copyright. 2012-07-27 18:27:21 +08:00
virsh-host.c util: set minimum value of nodesuspend duration to 60 seconds 2012-07-26 15:29:03 +08:00
virsh-interface.c virsh: Move command group definition into its own file 2012-07-26 12:00:43 +08:00
virsh-network.c virsh: Refactor error clearing on graceful fallback paths 2012-07-27 10:28:22 +02:00
virsh-nodedev.c virsh: Move command group definition into its own file 2012-07-26 12:00:43 +08:00
virsh-nwfilter.c virsh: Move command group definition into its own file 2012-07-26 12:00:43 +08:00
virsh-pool.c virsh: Refactor error clearing on graceful fallback paths 2012-07-27 10:28:22 +02:00
virsh-secret.c virsh: Move command group definition into its own file 2012-07-26 12:00:43 +08:00
virsh-snapshot.c virsh: Fix error resetting on fallback paths 2012-07-27 10:34:58 +02:00
virsh-volume.c virsh: Move command group definition into its own file 2012-07-26 12:00:43 +08:00
virsh.c maint: Use consistent copyright. 2012-07-27 18:27:21 +08:00
virsh.pod util: set minimum value of nodesuspend duration to 60 seconds 2012-07-26 15:29:03 +08:00
virt-host-validate-common.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virt-host-validate-common.h Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virt-host-validate-lxc.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virt-host-validate-lxc.h Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virt-host-validate-qemu.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virt-host-validate-qemu.h Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virt-host-validate.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virt-pki-validate.in Fixup manpage names and copyright dates 2012-07-25 12:46:29 -04:00
virt-sanlock-cleanup.in Fix virt-sanlock-cleanup documentation 2011-10-17 10:57:36 -06:00
virt-xml-validate.in maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00