diff options
author | David Ward <david.ward@ll.mit.edu> | 2012-04-29 16:47:07 -0400 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2012-05-01 17:51:26 +0200 |
commit | a41242bed823db77186ed7d11953cffaa0c3b733 (patch) | |
tree | a8ed68356623d056fcb42893a53ad29f27d673c7 /redhat/babeld.init | |
parent | 0bd268a5232f91c8cf01366b7ae43bcfed1dc8fe (diff) |
redhat: update initscripts
Taken from Fedora packaging with additional fixes.
* redhat/*.init: make all initscripts LSB-compliant;
store the daemon configuration file location in $CONF_FILE,
and perform existence testing before starting the daemon
* redhat/babeld.init: add initscript for Babel routing engine
* redhat/quagga.sysconfig: add command-line options for babeld;
remove the daemon configuration file locations from $*_OPTS;
clarify directions for configuring watchquagga
* redhat/Makefile.am: add babeld.init to distribution
Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'redhat/babeld.init')
-rw-r--r-- | redhat/babeld.init | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/redhat/babeld.init b/redhat/babeld.init new file mode 100644 index 00000000..76e8e5e0 --- /dev/null +++ b/redhat/babeld.init @@ -0,0 +1,72 @@ +#!/bin/bash +# chkconfig: - 16 84 +# config: /etc/quagga/babeld.conf + +### BEGIN INIT INFO +# Provides: babeld +# Short-Description: Babel routing engine +# Description: Babel routing engine for use with Zebra +### END INIT INFO + +# source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +# quagga command line options +. /etc/sysconfig/quagga + +RETVAL=0 +PROG="babeld" +cmd=babeld +LOCK_FILE=/var/lock/subsys/babeld +CONF_FILE=/etc/quagga/babeld.conf + +case "$1" in + start) + # Check that networking is up. + [ "${NETWORKING}" = "no" ] && exit 1 + + # The process must be configured first. + [ -f $CONF_FILE ] || exit 6 + if [ `id -u` -ne 0 ]; then + echo $"Insufficient privilege" 1>&2 + exit 4 + fi + + echo -n $"Starting $PROG: " + daemon $cmd -d $BABELD_OPTS -f $CONF_FILE + RETVAL=$? + [ $RETVAL -eq 0 ] && touch $LOCK_FILE + echo + ;; + stop) + echo -n $"Shutting down $PROG: " + killproc $cmd + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE + echo + ;; + restart|reload|force-reload) + $0 stop + $0 start + RETVAL=$? + ;; + condrestart|try-restart) + if [ -f $LOCK_FILE ]; then + $0 stop + $0 start + fi + RETVAL=$? + ;; + status) + status $cmd + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}" + exit 2 +esac + +exit $RETVAL |