Files
xen/tools/hotplug/Linux/init.d/xen-watchdog
T
user virtual 45244f3cd1 tools/hotplug/Linux: fix completely wrong attempts to stop xenwatchdogd
"xen-watchdog stop" attempts to kill non existing "watchdogd" but
misses the running "xenwatchdogd".  This also provokes errors during
install and Debian package management.

Signed-off-by: user virtual <virtualusr@gmail.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-25 16:42:00 +00:00

89 lines
1.4 KiB
Bash

#! /bin/bash
#
# xen-watchdog
#
# chkconfig: 2345 21 79
# description: Run domain watchdog daemon
### BEGIN INIT INFO
# Provides: xen-watchdog
# Required-Start: xend
# Should-Start: $syslog $remote_fs
# Required-Stop: xend
# Should-Stop: $syslog $remote_fs
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Start/stop xen-watchdog
# Description: Run domain watchdog daemon.
### END INIT INFO
#
DAEMON=/usr/sbin/xenwatchdogd
base=$(basename $DAEMON)
# Source function library.
if [ -e /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -e /lib/lsb/init-functions ] ; then
. /lib/lsb/init-functions
success () {
log_success_msg $*
}
failure () {
log_failure_msg $*
}
else
success () {
echo $*
}
failure () {
echo $*
}
fi
start() {
local r
echo -n $"Starting domain watchdog daemon: "
$DAEMON 30 15
r=$?
[ "$r" -eq 0 ] && success $"$base startup" || failure $"$base startup"
echo
return $r
}
stop() {
local r
echo -n $"Stopping domain watchdog daemon: "
killall -USR1 $base 2>/dev/null
r=$?
[ "$r" -eq 0 ] && success $"$base stop" || failure $"$base stop"
echo
return $r
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
;;
condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac