Files
xen/tools/hotplug/Linux/init.d/xen-watchdog.in
T
Olaf Hering 0fb6dbfaa8 tools/hotplug: allow tuning of xenwatchdogd arguments
Currently the arguments for xenwatchdogd are hardcoded with 15s
keep-alive interval and 30s timeout.

It is not possible to tweak these values via
/etc/systemd/system/xen-watchdog.service.d/*.conf because ExecStart
can not be replaced. The only option would be a private copy
/etc/systemd/system/xen-watchdog.service, which may get out of sync
with the Xen provided xen-watchdog.service.

Adjust the service file to recognize XENWATCHDOGD_ARGS= in a
private unit configuration file.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Wei Liu <wl@xen.org>
2020-12-04 11:51:14 +00:00

96 lines
1.6 KiB
Bash

#! /bin/bash
#
# xen-watchdog
#
# chkconfig: 2345 21 79
# description: Run domain watchdog daemon
### BEGIN INIT INFO
# Provides: xen-watchdog
# Required-Start: $syslog $remote_fs
# Should-Start: xend
# Required-Stop: $syslog $remote_fs
# Should-Stop: xend
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop xen-watchdog
# Description: Run domain watchdog daemon.
### END INIT INFO
#
. @XEN_SCRIPT_DIR@/hotplugpath.sh
xencommons_config=@CONFIG_DIR@/@CONFIG_LEAF_DIR@
test -f $xencommons_config/xencommons && . $xencommons_config/xencommons
test -n "$XENWATCHDOGD_ARGS" || XENWATCHDOGD_ARGS='30 15'
DAEMON=${sbindir}/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 $XENWATCHDOGD_ARGS
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