watchdog: Added first version of watchdog addon

This commit is contained in:
Dirk Wagner
2009-10-30 20:09:55 +01:00
parent 14094eeb72
commit 3f4aa73d56
8 changed files with 239 additions and 0 deletions

59
src/initscripts/init.d/watchdog Executable file
View File

@@ -0,0 +1,59 @@
#!/bin/sh
. /etc/sysconfig/rc
. ${rc_functions}
PATH=/bin:/usr/bin:/sbin:/usr/sbin
test -x /usr/sbin/watchdog || exit 0
# For configuration of the init script use the file
# /etc/sysconfig/watchdog, do not edit this init script.
# Set run_watchdog to 1 to start watchdog or 0 to disable it.
run_watchdog=0
# Specify additional watchdog options here (see manpage).
watchdog_options=""
# Specify module to load
watchdog_module="none"
[ -e /etc/sysconfig/watchdog ] && . /etc/sysconfig/watchdog
DAEMON=/usr/sbin/watchdog
WD_DAEMON=/usr/sbin/wd_keepalive
case "${1}" in
start)
boot_mesg "Starting watchdog ..."
if [ $run_watchdog = 1 ]
then
# do we have to load a module?
[ ${watchdog_module:-none} != "none" ] && /sbin/modprobe $watchdog_module
loadproc $DAEMON $watchdog_options
fi
;;
stop)
boot_mesg "Stopping watchdog ..."
killproc $DAEMON
;;
restart)
${0} stop
sleep 1
${0} start
;;
status)
statusproc $DAEMON
;;
*)
echo "Usage: ${0} {start|stop|restart|status}"
exit 1
;;
esac