MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //etc/rc.d/rc5.d/S27watchdog
#! /bin/sh
#
# chkconfig: - 27 46
# description: A software watchdog
#
# rc file author: Marc Merlin <marcsoft@merlins.org>
#                 Henning P. Schmiedehausen <hps@tanstaafl.de>

# Source function library.
. /etc/rc.d/init.d/functions

[ -x /usr/sbin/watchdog -a -e /etc/watchdog.conf ] || exit 0

VERBOSE="no"
SOFTREBOOT="no"
OPTIONS=" "
if [ -f /etc/sysconfig/watchdog ]; then
    . /etc/sysconfig/watchdog
fi

RETVAL=0
prog=watchdog
pidfile=/var/run/watchdog.pid
lockfile=/var/lock/subsys/watchdog

start() {

	echo -n $"Starting $prog: "
	if [ -n "$(pidofproc $prog)" ]; then
		echo -n $"$prog: already running"
		echo_failure
		echo
		return 1
	fi
	if [ "$VERBOSE" = "yes" ]; then
		OPTIONS="$OPTIONS \-v"
	fi
	if [ "$SOFTREBOOT" = "yes" ]; then
		OPTIONS="$OPTIONS \-b"
	fi

	daemon /usr/sbin/${prog} $OPTIONS

#	if [ "$VERBOSE" = "yes" ]; then
#	    daemon /usr/sbin/${prog} -v
#	else
#	    daemon /usr/sbin/${prog}
#        fi
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch $lockfile
	[ $RETVAL -eq 0 ] && echo_success
	[ $RETVAL -ne 0 ] && echo_failure
	echo
	return $RETVAL
}

stop() {
	echo -n "Stopping $prog: "
	# We are forcing it to _only_ use -TERM as killproc could use
	# -KILL which would result in BMC timer not being set properly 
	# and reboot the box.
	killproc $prog -TERM
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile
	return $RETVAL
}

restart() {
  	stop
	sleep 6
	start
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  reload|restart)
  	restart
	;;
  condrestart)
    if [ -f $lockfile ]; then
		restart
    fi
    ;;
  status)
	status $prog
	RETVAL=$?
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|status|condrestart}"
	exit 1
esac