Create a gist now

Instantly share code, notes, and snippets.

--- /etc/init.d/libvirt-bin.org 2009-12-10 23:38:47.000000000 +0900
+++ /etc/init.d/libvirt-bin 2010-01-15 17:14:46.000000000 +0900
@@ -19,6 +19,7 @@
DAEMON=/usr/sbin/libvirtd
NAME=libvirtd
DESC="libvirt management daemon"
+STARTSTOPVM=/etc/libvirt/libvirt-start-stop-vm.sh
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
@@ -99,6 +100,7 @@
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $libvirtd_opts
if running; then
+ $STARTSTOPVM start
log_end_msg 0
else
log_end_msg 1
@@ -112,6 +114,7 @@
log_end_msg 0
exit 0
fi
+ $STARTSTOPVM stop
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
log_end_msg 0
@@ -128,12 +131,14 @@
restart)
if check_start_libvirtd_option; then
log_daemon_msg "Restarting $DESC" "$DAEMON"
+ $STARTSTOPVM stop
start-stop-daemon --oknodo --stop --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
[ -n "$DODTIME" ] && sleep $DODTIME
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON -- $libvirtd_opts
if running; then
+ $STARTSTOPVM start
log_end_msg 0
else
log_end_msg 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment