version 1.1.1.1, 2012/02/21 17:26:12
|
version 1.1.1.2, 2012/10/09 09:22:29
|
Line 1
|
Line 1
|
#!/bin/bash |
#!/bin/bash |
# |
|
# chkconfig: 2345 17 83 |
# chkconfig: 2345 17 83 |
# description: A Quagga watchdog for use with Zebra |
|
# |
|
# processname: watchquagga |
|
|
|
|
### BEGIN INIT INFO |
|
# Provides: watchquagga |
|
# Short-Description: Quagga watchdog |
|
# Description: Quagga watchdog for use with Zebra |
|
### END INIT INFO |
|
|
# source function library |
# source function library |
. /etc/rc.d/init.d/functions |
. /etc/rc.d/init.d/functions |
|
|
Line 14
|
Line 16
|
# quagga command line options |
# quagga command line options |
. /etc/sysconfig/quagga |
. /etc/sysconfig/quagga |
|
|
# Check that networking is up. |
|
[ "${NETWORKING}" = "no" ] && exit 0 |
|
|
|
# Check that there are daemons to be monitored. |
|
[ -z "$WATCH_DAEMONS" ] && exit 0 |
|
|
|
RETVAL=0 |
RETVAL=0 |
prog="watchquagga" | PROG="watchquagga" |
| cmd=watchquagga |
| LOCK_FILE=/var/lock/subsys/watchquagga |
|
|
case "$1" in |
case "$1" in |
start) |
start) |
echo -n $"Starting $prog: " | # Check that networking is up. |
daemon /usr/sbin/watchquagga -d $WATCH_OPTS $WATCH_DAEMONS | [ "${NETWORKING}" = "no" ] && exit 1 |
| |
| # Check that there are daemons to be monitored. |
| [ -z "$WATCH_DAEMONS" ] && exit 1 |
| |
| echo -n $"Starting $PROG: " |
| daemon $cmd -d $WATCH_OPTS $WATCH_DAEMONS |
RETVAL=$? |
RETVAL=$? |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/watchquagga | [ $RETVAL -eq 0 ] && touch $LOCK_FILE |
echo |
echo |
;; |
;; |
stop) |
stop) |
echo -n $"Shutting down $prog: " | echo -n $"Shutting down $PROG: " |
killproc watchquagga | killproc $cmd |
RETVAL=$? |
RETVAL=$? |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/watchquagga | [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE |
echo |
echo |
;; |
;; |
restart|reload) | restart|reload|force-reload) |
$0 stop | $0 stop |
$0 start | $0 start |
RETVAL=$? |
RETVAL=$? |
;; | ;; |
condrestart) | condrestart|try-restart) |
if [ -f /var/lock/subsys/watchquagga ]; then | if [ -f $LOCK_FILE ]; then |
$0 stop | $0 stop |
$0 start |
$0 start |
fi | fi |
RETVAL=$? |
RETVAL=$? |
;; | ;; |
status) |
status) |
status watchquagga | status $cmd |
RETVAL=$? |
RETVAL=$? |
;; | ;; |
*) |
*) |
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" | echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}" |
exit 1 | exit 2 |
esac |
esac |
|
|
exit $RETVAL |
exit $RETVAL |