mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-13 04:22:58 +02:00
watchdog: Added first version of watchdog addon
This commit is contained in:
59
src/initscripts/init.d/watchdog
Executable file
59
src/initscripts/init.d/watchdog
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user