From b9fd13f91e66283c8c25645d9cda904ff3fbdceb5b71d559d526eb7362ac9dce Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Wed, 13 Oct 2010 23:46:24 +0000 Subject: [PATCH] libvirt init script improvements OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=70 --- libvirt.changes | 7 +++++++ libvirtd.init | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/libvirt.changes b/libvirt.changes index abd1cce..2e161d4 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Oct 13 17:44:27 MDT 2010 - jfehlig@novell.com + +- cannot restart dead libvirtd without manually removing pidfile + modified libvirtd.init + bnc#645755 + ------------------------------------------------------------------- Mon Oct 11 19:04:21 UTC 2010 - cristian.rodriguez@opensuse.org diff --git a/libvirtd.init b/libvirtd.init index a4aad0e..42a0158 100644 --- a/libvirtd.init +++ b/libvirtd.init @@ -19,6 +19,7 @@ LIBVIRTD_BIN=/usr/sbin/libvirtd +LIBVIRTD_PIDFILE=/var/run/libvirtd.pid test -x $LIBVIRTD_BIN || { echo "$LIBVIRD_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } @@ -30,6 +31,16 @@ rc_reset case "$1" in start) + if [ -e $LIBVIRTD_PIDFILE ]; then + if checkproc $LIBVIRTD_BIN ; then + echo -n "libvirtd is already running." + rc_status -v + exit + else + echo "Removing stale PID file $LIBVIRTD_PIDFILE." + rm -f $LIBVIRTD_PIDFILE + fi + fi echo -n "Starting libvirtd " startproc $LIBVIRTD_BIN -d -l rc_status -v @@ -37,6 +48,7 @@ case "$1" in stop) echo -n "Shutting down libvirtd " killproc -TERM $LIBVIRTD_BIN > /dev/null 2>&1 + rm -f $LIBVIRTD_PIDFILE rc_status -v ;; try-restart)