be647ac04a
- fixed and added initscript of watchquagga daemon
767 lines
18 KiB
Diff
767 lines
18 KiB
Diff
diff -up quagga-0.99.16/redhat/bgpd.init.posix quagga-0.99.16/redhat/bgpd.init
|
|
--- quagga-0.99.16/redhat/bgpd.init.posix 2010-03-17 14:11:26.681170285 +0100
|
|
+++ quagga-0.99.16/redhat/bgpd.init 2010-03-17 14:13:47.943170024 +0100
|
|
@@ -1,10 +1,12 @@
|
|
#!/bin/bash
|
|
-#
|
|
-# chkconfig: 2345 16 84
|
|
-# description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Zebra
|
|
-#
|
|
-# processname: bgpd
|
|
-# config: /etc/zebra/bgpd.conf
|
|
+# chkconfig: - 16 84
|
|
+# config: /etc/quagga/bgpd.conf
|
|
+
|
|
+### BEGIN INIT INFO
|
|
+# Provides: bgpd
|
|
+# Short-Description: A BGPv4, BGPv4+, BGPv4- routing engine
|
|
+# Description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Zebra
|
|
+### END INIT INFO
|
|
|
|
# source function library
|
|
. /etc/rc.d/init.d/functions
|
|
@@ -15,49 +17,57 @@
|
|
# quagga command line options
|
|
. /etc/sysconfig/quagga
|
|
|
|
-# Check that networking is up.
|
|
-[ "${NETWORKING}" = "no" ] && exit 0
|
|
-
|
|
-# The process must be configured first.
|
|
-[ -f /etc/quagga/bgpd.conf ] || exit 0
|
|
|
|
RETVAL=0
|
|
-prog="bgpd"
|
|
+PROG="bgpd"
|
|
+cmd=bgpd
|
|
+LOCK_FILE=/var/lock/subsys/bgpd
|
|
+CONF_FILE=/etc/quagga/bgpd.conf
|
|
|
|
case "$1" in
|
|
start)
|
|
- echo -n $"Starting $prog: "
|
|
- daemon /usr/sbin/bgpd -d $BGPD_OPTS
|
|
+ # 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 $BGPD_OPTS
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd
|
|
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
|
|
echo
|
|
;;
|
|
stop)
|
|
- echo -n $"Shutting down $prog: "
|
|
- killproc bgpd
|
|
+ echo -n $"Shutting down $PROG: "
|
|
+ killproc $cmd
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bgpd
|
|
+ [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
|
|
echo
|
|
;;
|
|
- restart|reload)
|
|
+ restart|reload|force-reload)
|
|
$0 stop
|
|
$0 start
|
|
RETVAL=$?
|
|
;;
|
|
- condrestart)
|
|
- if [ -f /var/lock/subsys/bgpd ]; then
|
|
+ condrestart|try-restart)
|
|
+ if [ -f $LOCK_FILE ]; then
|
|
$0 stop
|
|
$0 start
|
|
fi
|
|
RETVAL=$?
|
|
;;
|
|
status)
|
|
- status bgpd
|
|
+ status $cmd
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
- echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
|
|
- exit 1
|
|
+ echo $"Usage: $0 {start|stop|restart|reload|force-reload|try-restart|status}"
|
|
+ exit 2
|
|
esac
|
|
|
|
exit $RETVAL
|
|
diff -up quagga-0.99.16/redhat/isisd.init.posix quagga-0.99.16/redhat/isisd.init
|
|
--- quagga-0.99.16/redhat/isisd.init.posix 2010-03-17 14:11:26.704385156 +0100
|
|
+++ quagga-0.99.16/redhat/isisd.init 2010-03-17 14:13:47.943170024 +0100
|
|
@@ -1,40 +1,44 @@
|
|
#!/bin/bash
|
|
-#
|
|
-# chkconfig: 2345 16 84
|
|
-# description: An ISIS routing engine for use with Quagga
|
|
-#
|
|
-# processname: isisd
|
|
+# chkconfig: - 16 84
|
|
# config: /etc/quagga/isisd.conf
|
|
|
|
+### BEGIN INIT INFO
|
|
+# Provides: isisd
|
|
+# Short-Description: An ISIS routing engine
|
|
+# Description: An ISIS routing engine for use with Quagga
|
|
+### END INIT INFO
|
|
+
|
|
# source function library
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
# Get network config
|
|
. /etc/sysconfig/network
|
|
|
|
-# Check that networking is up.
|
|
-[ "${NETWORKING}" = "no" ] && exit 0
|
|
-
|
|
-# The process must be configured first.
|
|
-[ -f /etc/quagga/isisd.conf ] || exit 0
|
|
-
|
|
RETVAL=0
|
|
-
|
|
-prog="isisd"
|
|
+PROG="isisd"
|
|
+cmd=isisd
|
|
+LOCK_FILE=/var/lock/subsys/isisd
|
|
+CONF_FILE=/etc/quagga/isisd.conf
|
|
|
|
case "$1" in
|
|
start)
|
|
- echo -n $"Starting $prog: "
|
|
- daemon /usr/sbin/isisd -d
|
|
+ # Check that networking is up.
|
|
+ [ "${NETWORKING}" = "no" ] && exit 1
|
|
+
|
|
+ # The process must be configured first.
|
|
+ [ -f $CONF_FILE] || exit 6
|
|
+
|
|
+ echo -n $"Starting $PROG: "
|
|
+ daemon $cmd -d
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/isisd
|
|
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
|
|
echo
|
|
;;
|
|
stop)
|
|
- echo -n $"Shutting down $prog: "
|
|
- killproc isisd
|
|
+ echo -n $"Shutting down $PROG: "
|
|
+ killproc $cmd
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/isisd
|
|
+ [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
|
|
echo
|
|
;;
|
|
restart|reload)
|
|
@@ -43,19 +47,19 @@ case "$1" in
|
|
RETVAL=$?
|
|
;;
|
|
condrestart)
|
|
- if [ -f /var/lock/subsys/isisd ]; then
|
|
+ if [ -f $LOCK_FILE ]; then
|
|
$0 stop
|
|
$0 start
|
|
fi
|
|
RETVAL=$?
|
|
;;
|
|
status)
|
|
- status isisd
|
|
+ status $cmd
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
|
|
- exit 1
|
|
+ exit 2
|
|
esac
|
|
|
|
exit $RETVAL
|
|
diff -up quagga-0.99.16/redhat/ospf6d.init.posix quagga-0.99.16/redhat/ospf6d.init
|
|
--- quagga-0.99.16/redhat/ospf6d.init.posix 2010-03-17 14:11:26.707387563 +0100
|
|
+++ quagga-0.99.16/redhat/ospf6d.init 2010-03-17 14:13:47.944168987 +0100
|
|
@@ -1,11 +1,13 @@
|
|
#!/bin/bash
|
|
-#
|
|
-# chkconfig: 2345 16 84
|
|
-# description: An OSPF routing engine for use with Zebra and IPv6
|
|
-#
|
|
-# processname: ospf6d
|
|
+# chkconfig: - 16 84
|
|
# config: /etc/quagga/ospf6d.conf
|
|
|
|
+### BEGIN INIT INFO
|
|
+# Provides: ospf6d
|
|
+# Short-Description: A OSPF routing engine for IPv6
|
|
+# Description: An OSPF routing engine for use with Zebra and IPv6
|
|
+### END INIT INFO
|
|
+
|
|
# source function library
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
@@ -15,49 +17,56 @@
|
|
# quagga command line options
|
|
. /etc/sysconfig/quagga
|
|
|
|
-# Check that networking is up.
|
|
-[ "${NETWORKING_IPV6}" = "no" ] && exit 0
|
|
-
|
|
-# The process must be configured first.
|
|
-[ -f /etc/quagga/ospf6d.conf ] || exit 0
|
|
-
|
|
RETVAL=0
|
|
-prog="ospf6d"
|
|
+PROG="ospf6d"
|
|
+cmd=ospf6d
|
|
+LOCK_FILE=/var/lock/subsys/ospf6d
|
|
+CONF_FILE=/etc/quagga/ospf6d.conf
|
|
|
|
case "$1" in
|
|
start)
|
|
- echo -n $"Starting $prog: "
|
|
- daemon /usr/sbin/ospf6d -d $OSPF6D_OPTS
|
|
+ # 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 $OSPF6D_OPTS
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospf6d
|
|
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
|
|
echo
|
|
;;
|
|
stop)
|
|
- echo -n $"Shutting down $prog: "
|
|
- killproc ospf6d
|
|
+ echo -n $"Shutting down $PROG: "
|
|
+ killproc $cmd
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospf6d
|
|
+ [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
|
|
echo
|
|
;;
|
|
- restart|reload)
|
|
+ restart|reload|force-reload)
|
|
$0 stop
|
|
$0 start
|
|
RETVAL=$?
|
|
;;
|
|
- condrestart)
|
|
- if [ -f /var/lock/subsys/ospf6d ]; then
|
|
+ condrestart|try-restart)
|
|
+ if [ -f $LOCK_FILE ]; then
|
|
$0 stop
|
|
$0 start
|
|
fi
|
|
RETVAL=$?
|
|
;;
|
|
status)
|
|
- status ospf6d
|
|
+ status $cmd
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
- echo $"Usage: $prog {start|stop|restart|reload|condrestart|status}"
|
|
- exit 1
|
|
+ echo $"Usage: $PROG {start|stop|restart|reload|force-reload|try-restart|status}"
|
|
+ exit 2
|
|
esac
|
|
|
|
exit $RETVAL
|
|
diff -up quagga-0.99.16/redhat/ospfd.init.posix quagga-0.99.16/redhat/ospfd.init
|
|
--- quagga-0.99.16/redhat/ospfd.init.posix 2010-03-17 14:11:26.709400924 +0100
|
|
+++ quagga-0.99.16/redhat/ospfd.init 2010-03-17 14:13:47.944168987 +0100
|
|
@@ -1,11 +1,13 @@
|
|
#!/bin/bash
|
|
-#
|
|
-# chkconfig: 2345 16 84
|
|
-# description: An OSPF v2 routing engine for use with Zebra
|
|
-#
|
|
-# processname: ospfd
|
|
+# chkconfig: - 16 84
|
|
# config: /etc/quagga/ospfd.conf
|
|
|
|
+### BEGIN INIT INFO
|
|
+# Provides: ospfd
|
|
+# Short-Description: A OSPF v2 routing engine
|
|
+# Description: An OSPF v2 routing engine for use with Zebra
|
|
+### END INIT INFO
|
|
+
|
|
# source function library
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
@@ -15,50 +17,56 @@
|
|
# quagga command line options
|
|
. /etc/sysconfig/quagga
|
|
|
|
-# Check that networking is up.
|
|
-[ "${NETWORKING}" = "no" ] && exit 0
|
|
-
|
|
-# The process must be configured first.
|
|
-[ -f /etc/quagga/ospfd.conf ] || exit 0
|
|
-
|
|
RETVAL=0
|
|
-
|
|
-prog="ospfd"
|
|
+PROG="ospfd"
|
|
+cmd=ospfd
|
|
+LOCK_FILE=/var/lock/subsys/ospfd
|
|
+CONF_FILE=/etc/quagga/ospfd.conf
|
|
|
|
case "$1" in
|
|
start)
|
|
- echo -n $"Starting $prog: "
|
|
- daemon /usr/sbin/ospfd -d $OSPFD_OPTS
|
|
+ # 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 $OSPFD_OPTS
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospfd
|
|
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
|
|
echo
|
|
;;
|
|
stop)
|
|
- echo -n $"Shutting down $prog: "
|
|
- killproc ospfd
|
|
+ echo -n $"Shutting down $PROG: "
|
|
+ killproc $cmd
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospfd
|
|
+ [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
|
|
echo
|
|
;;
|
|
- restart|reload)
|
|
+ restart|reload|force-reload)
|
|
$0 stop
|
|
$0 start
|
|
RETVAL=$?
|
|
;;
|
|
- condrestart)
|
|
- if [ -f /var/lock/subsys/ospfd ]; then
|
|
+ condrestart|try-restart)
|
|
+ if [ -f $LOCK_FILE ]; then
|
|
$0 stop
|
|
$0 start
|
|
fi
|
|
RETVAL=$?
|
|
;;
|
|
status)
|
|
- status ospfd
|
|
+ status $cmd
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
- echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
|
|
- exit 1
|
|
+ echo $"Usage: $PROG {start|stop|restart|reload|force-reload|try-restart|status}"
|
|
+ exit 2
|
|
esac
|
|
|
|
exit $RETVAL
|
|
diff -up quagga-0.99.16/redhat/ripd.init.posix quagga-0.99.16/redhat/ripd.init
|
|
--- quagga-0.99.16/redhat/ripd.init.posix 2010-03-17 14:11:26.711384881 +0100
|
|
+++ quagga-0.99.16/redhat/ripd.init 2010-03-17 14:13:47.944168987 +0100
|
|
@@ -1,11 +1,13 @@
|
|
#!/bin/bash
|
|
-#
|
|
-# chkconfig: 2345 16 84
|
|
-# description: A RIP routing engine for use with Zebra
|
|
-#
|
|
-# processname: ripd
|
|
+# chkconfig: - 16 84
|
|
# config: /etc/quagga/ripd.conf
|
|
|
|
+### BEGIN INIT INFO
|
|
+# Provides: ripd
|
|
+# Short-Description: A RIP routing engine
|
|
+# Description: A RIP routing engine for use with Zebra
|
|
+### END INIT INFO
|
|
+
|
|
# source function library
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
@@ -15,49 +17,56 @@
|
|
# quagga command line options
|
|
. /etc/sysconfig/quagga
|
|
|
|
-# Check that networking is up.
|
|
-[ "${NETWORKING}" = "no" ] && exit 0
|
|
-
|
|
-# The process must be configured first.
|
|
-[ -f /etc/quagga/ripd.conf ] || exit 0
|
|
-
|
|
RETVAL=0
|
|
-prog="ripd"
|
|
+PROG="ripd"
|
|
+cmd=ripd
|
|
+LOCK_FILE=/var/lock/subsys/ripd
|
|
+CONF_FILE=/etc/quagga/ripd.conf
|
|
|
|
case "$1" in
|
|
start)
|
|
- echo -n $"Starting $prog: "
|
|
- daemon /usr/sbin/ripd -d $RIPD_OPTS
|
|
+ # 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 $RIPD_OPTS
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripd
|
|
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
|
|
echo
|
|
;;
|
|
stop)
|
|
- echo -n $"Shutting down $prog: "
|
|
- killproc ripd
|
|
+ echo -n $"Shutting down $PROG: "
|
|
+ killproc $cmd
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripd
|
|
+ [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
|
|
echo
|
|
;;
|
|
- restart|reload)
|
|
+ restart|reload|force-reload)
|
|
$0 stop
|
|
$0 start
|
|
RETVAL=$?
|
|
;;
|
|
- condrestart)
|
|
- if [ -f /var/lock/subsys/ripd ]; then
|
|
+ condrestart|try-restart)
|
|
+ if [ -f $LOCK_FILE ]; then
|
|
$0 stop
|
|
$0 start
|
|
fi
|
|
RETVAL=$?
|
|
;;
|
|
status)
|
|
- status ripd
|
|
+ status $cmd
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
- echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
|
|
- exit 1
|
|
+ echo $"Usage: $0 {start|stop|restart|reload|force-reload|try-restart|status}"
|
|
+ exit 2
|
|
esac
|
|
|
|
exit $RETVAL
|
|
diff -up quagga-0.99.16/redhat/ripngd.init.posix quagga-0.99.16/redhat/ripngd.init
|
|
--- quagga-0.99.16/redhat/ripngd.init.posix 2010-03-17 14:11:26.713385042 +0100
|
|
+++ quagga-0.99.16/redhat/ripngd.init 2010-03-17 14:13:47.945166204 +0100
|
|
@@ -1,11 +1,13 @@
|
|
#!/bin/bash
|
|
-#
|
|
-# chkconfig: 2345 16 84
|
|
-# description: A RIP routing engine for use with Zebra and IPv6
|
|
-#
|
|
-# processname: ripngd
|
|
+# chkconfig: - 16 84
|
|
# config: /etc/quagga/ripngd.conf
|
|
|
|
+### BEGIN INIT INFO
|
|
+# Provides: ripngd
|
|
+# Short-Description: A RIP routing engine for IPv6
|
|
+# Description: A RIP routing engine for use with Zebra and IPv6
|
|
+### END INIT INFO
|
|
+
|
|
# source function library
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
@@ -15,49 +17,56 @@
|
|
# quagga command line options
|
|
. /etc/sysconfig/quagga
|
|
|
|
-# Check that networking is up.
|
|
-[ "${NETWORKING_IPV6}" = "no" ] && exit 0
|
|
-
|
|
-# The process must be configured first.
|
|
-[ -f /etc/quagga/ripngd.conf ] || exit 0
|
|
-
|
|
RETVAL=0
|
|
-prog="ripngd"
|
|
+PROG="ripngd"
|
|
+cmd=ripngd
|
|
+LOCK_FILE=/var/lock/subsys/ripngd
|
|
+CONF_FILE=/etc/quagga/ripngd.conf
|
|
|
|
case "$1" in
|
|
start)
|
|
- echo -n $"Starting $prog: "
|
|
- daemon /usr/sbin/ripngd -d $RIPNGD_OPTS
|
|
+ # 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 $RIPNGD_OPTS
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripngd
|
|
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
|
|
echo
|
|
;;
|
|
stop)
|
|
- echo -n $"Shutting down $prog: "
|
|
- killproc ripngd
|
|
+ echo -n $"Shutting down $PROG: "
|
|
+ killproc $cmd
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripngd
|
|
+ [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
|
|
echo
|
|
;;
|
|
- restart|reload)
|
|
+ restart|reload|force-reload)
|
|
$0 stop
|
|
$0 start
|
|
RETVAL=$?
|
|
;;
|
|
- condrestart)
|
|
- if [ -f /var/lock/subsys/ripngd ]; then
|
|
+ condrestart|try-restart)
|
|
+ if [ -f $LOCK_FILE ]; then
|
|
$0 stop
|
|
$0 start
|
|
fi
|
|
RETVAL=$?
|
|
;;
|
|
status)
|
|
- status ripngd
|
|
+ status $cmd
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
- echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
|
|
- exit 1
|
|
+ echo $"Usage: $0 {start|stop|restart|reload|force-reload|try-restart|status}"
|
|
+ exit 2
|
|
esac
|
|
|
|
exit $RETVAL
|
|
diff -up quagga-0.99.16/redhat/watchquagga.init.posix quagga-0.99.16/redhat/watchquagga.init
|
|
--- quagga-0.99.16/redhat/watchquagga.init.posix 2010-03-17 14:11:26.715399800 +0100
|
|
+++ quagga-0.99.16/redhat/watchquagga.init 2010-03-17 14:13:47.945166204 +0100
|
|
@@ -1,9 +1,10 @@
|
|
#!/bin/bash
|
|
-#
|
|
+### BEGIN INIT INFO
|
|
+# Provides: watchquagga
|
|
# chkconfig: 2345 17 83
|
|
-# description: A Quagga watchdog for use with Zebra
|
|
-#
|
|
-# processname: watchquagga
|
|
+# Short-Description: A Quagga watchdog
|
|
+# Description: A Quagga watchdog for use with Zebra
|
|
+### END INIT INFO
|
|
|
|
# source function library
|
|
. /etc/rc.d/init.d/functions
|
|
@@ -14,28 +15,30 @@
|
|
# quagga command line options
|
|
. /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
|
|
-prog="watchquagga"
|
|
+PROG="watchquagga"
|
|
+cmd=watchquagga
|
|
+LOCK_FILE=/var/lock/subsys/watchquagga
|
|
|
|
case "$1" in
|
|
start)
|
|
+ # Check that networking is up.
|
|
+ [ "${NETWORKING}" = "no" ] && exit 1
|
|
+
|
|
+ # Check that there are daemons to be monitored.
|
|
+ [ -z "$WATCH_DAEMONS" ] && exit 1
|
|
+
|
|
echo -n $"Starting $prog: "
|
|
- daemon /usr/sbin/watchquagga -d $WATCH_OPTS $WATCH_DAEMONS
|
|
+ daemon $cmd -d $WATCH_OPTS $WATCH_DAEMONS
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/watchquagga
|
|
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
|
|
echo
|
|
;;
|
|
stop)
|
|
- echo -n $"Shutting down $prog: "
|
|
- killproc watchquagga
|
|
+ echo -n $"Shutting down $PROG: "
|
|
+ killproc $cmd
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/watchquagga
|
|
+ [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
|
|
echo
|
|
;;
|
|
restart|reload)
|
|
@@ -44,19 +47,19 @@ case "$1" in
|
|
RETVAL=$?
|
|
;;
|
|
condrestart)
|
|
- if [ -f /var/lock/subsys/watchquagga ]; then
|
|
+ if [ -f $LOCK_FILE ]; then
|
|
$0 stop
|
|
$0 start
|
|
fi
|
|
RETVAL=$?
|
|
;;
|
|
status)
|
|
- status watchquagga
|
|
+ status $cmd
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
|
|
- exit 1
|
|
+ exit 2
|
|
esac
|
|
|
|
exit $RETVAL
|
|
diff -up quagga-0.99.16/redhat/zebra.init.posix quagga-0.99.16/redhat/zebra.init
|
|
--- quagga-0.99.16/redhat/zebra.init.posix 2010-03-17 14:11:26.717385084 +0100
|
|
+++ quagga-0.99.16/redhat/zebra.init 2010-03-17 14:13:47.945166204 +0100
|
|
@@ -1,64 +1,72 @@
|
|
#!/bin/bash
|
|
-#
|
|
-# chkconfig: 2345 15 85
|
|
-# description: GNU Zebra routing manager
|
|
-#
|
|
-# processname: zebra
|
|
+# chkconfig: - 15 85
|
|
# config: /etc/quagga/zebra.conf
|
|
|
|
+### BEGIN INIT INFO
|
|
+# Provides: zebra
|
|
+# Short-Description: GNU Zebra routing manager
|
|
+# Description: GNU Zebra routing manager
|
|
+### END INIT INFO
|
|
+
|
|
# source function library
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
# quagga command line options
|
|
. /etc/sysconfig/quagga
|
|
|
|
-# Check that networking is up.
|
|
-[ "${NETWORKING}" = "no" ] && exit 0
|
|
-
|
|
-# The process must be configured first.
|
|
-[ -f /etc/quagga/zebra.conf ] || exit 0
|
|
-
|
|
RETVAL=0
|
|
-
|
|
-prog="zebra"
|
|
+PROG="zebra"
|
|
+cmd=zebra
|
|
+LOCK_FILE=/var/lock/subsys/zebra
|
|
+CONF_FILE=/etc/quagga/zebra.conf
|
|
|
|
case "$1" in
|
|
start)
|
|
- echo -n $"Starting $prog: "
|
|
+ # 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: "
|
|
|
|
/sbin/ip route flush proto zebra
|
|
|
|
- daemon /usr/sbin/zebra -d $ZEBRA_OPTS
|
|
+ daemon $cmd -d $ZEBRA_OPTS
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zebra
|
|
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
|
|
echo
|
|
;;
|
|
stop)
|
|
- echo -n $"Shutting down $prog: "
|
|
- killproc zebra
|
|
+ echo -n $"Shutting down $PROG: "
|
|
+ killproc $cmd
|
|
RETVAL=$?
|
|
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zebra
|
|
+ [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
|
|
echo
|
|
;;
|
|
- restart|reload)
|
|
+ restart|reload|force-reload)
|
|
$0 stop
|
|
$0 start
|
|
RETVAL=$?
|
|
;;
|
|
- condrestart)
|
|
- if [ -f /var/lock/subsys/zebra ]; then
|
|
+ condrestart|try-restart)
|
|
+ if [ -f $LOCK_FILE ]; then
|
|
$0 stop
|
|
$0 start
|
|
fi
|
|
RETVAL=$?
|
|
;;
|
|
status)
|
|
- status zebra
|
|
+ status $cmd
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
- echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
|
|
- exit 1
|
|
+ echo $"Usage: $0 {start|stop|restart|reload|force-reload|try-restart|status}"
|
|
+ exit 2
|
|
esac
|
|
|
|
exit $RETVAL
|