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
055744cdbc 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 <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Mark Asselstine 2015-09-16 12:26:38 -04:00 committed by Bruce Ashfield
parent a27d411aef
commit a7841b8560

View File

@ -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