From a7841b85605ff1645675cab77569ff7576af9530 Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Wed, 16 Sep 2015 12:26:38 -0400 Subject: libvirt: Properly shutdown libvirtd.service We build libvirt without support for sd_notify (dbus) therefor we have to run libvirtd as a 'forking daemon' (per commit 055744cdbc1526d966091158c8fae2d22c905db4 we pass --daemon) We need to update the systemd service file to reflect this such that the libvirtd.service can be properly stopped. If we ever enable sd_notify support in libvirt we can revert back to using the 'notify' systemd type. Without this change libvirtd continue to run even if the stop command is issued, subsequent attempts to start the service will fail. Signed-off-by: Mark Asselstine Signed-off-by: Bruce Ashfield --- recipes-extended/libvirt/libvirt_1.2.19.bb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes-extended/libvirt/libvirt_1.2.19.bb b/recipes-extended/libvirt/libvirt_1.2.19.bb index f4333218..df53d59a 100644 --- a/recipes-extended/libvirt/libvirt_1.2.19.bb +++ b/recipes-extended/libvirt/libvirt_1.2.19.bb @@ -225,6 +225,11 @@ do_install_append() { if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then # This variable is used by libvirtd.service to start libvirtd in the right mode sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/sysconfig/libvirtd + + # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities. + sed -i -e 's/Type=notify/Type=forking/' \ + -e '/Type=forking/a PIDFile=${localstatedir}/run/libvirtd.pid' \ + ${D}/${systemd_unitdir}/system/libvirtd.service fi # The /var/run/libvirt directories created by the Makefile -- cgit v1.2.3-54-g00ecf