From 8484b64fa334bfb063b059883f6fe15a53052c8c Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Mon, 3 Mar 2014 11:55:14 -0500 Subject: libvirt: kill the right dnsmasq daemon Currently when libvirt daemon is stared, the libvirt startup script tries to kill the already running dnsmasq daemons (e.g. from /etc/init.d/dnsmaqs). Also if "/etc/init.d/libvirtd start" is invoked more than one time then this will accidentally kills all the dnsmasq daemon. This patch makes sure libvirt startup script to kill only the dnsmasq that spawned by itself. Also try to avoid killing dnsmasq if "/etc/init.d/libvirtd start" runs second time. Signed-off-by: Barton Wensley Signed-off-by: Vu Tran Signed-off-by: Bruce Ashfield --- recipes-extended/libvirt/libvirt/libvirtd.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'recipes-extended') diff --git a/recipes-extended/libvirt/libvirt/libvirtd.sh b/recipes-extended/libvirt/libvirt/libvirtd.sh index 8d61c70e..29dbf391 100755 --- a/recipes-extended/libvirt/libvirt/libvirtd.sh +++ b/recipes-extended/libvirt/libvirt/libvirtd.sh @@ -79,7 +79,9 @@ case "$1" in fi fi log_begin_msg "Starting virtualization library daemon: libvirtd" - start-stop-daemon -K -x /usr/bin/dnsmasq + if [ ! -e /var/run/libvirtd.pid ]; then + start-stop-daemon -K -x /usr/bin/dnsmasq --pidfile /var/run/libvirt/network/default.pid + fi start-stop-daemon --start --quiet --pidfile /var/run/libvirtd.pid --exec /usr/sbin/libvirtd -- --daemon --listen log_end_msg $? ;; -- cgit v1.2.3-54-g00ecf