summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-03-09 22:40:43 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-03-09 22:40:43 -0700
commit55c563c5482c95fb81c7e18a0e16aade07ffb2dc (patch)
tree15a90c82898e691e8c6b68dc416898c9971fc5e5
parentec05b6c4ea4a80424bac4d26f91a618f81a9a8c6 (diff)
downloadvyatta-cfg-quagga-55c563c5482c95fb81c7e18a0e16aade07ffb2dc.tar.gz
vyatta-cfg-quagga-55c563c5482c95fb81c7e18a0e16aade07ffb2dc.zip
Manage daemon restart correctly
Need to look at exists (after commit) rather than original list of daemons. Bug 4192
-rwxr-xr-xscripts/quagga-manager40
1 files changed, 20 insertions, 20 deletions
diff --git a/scripts/quagga-manager b/scripts/quagga-manager
index dc1f3ab5..1a62eabd 100755
--- a/scripts/quagga-manager
+++ b/scripts/quagga-manager
@@ -35,16 +35,16 @@ start() {
zebra) args+=( -l -S -s 1048576 ) ;;
watchquagga)
args=( -dz -p ${pid_dir}/${daemon}.pid );
- local -a daemons=(`/opt/vyatta/bin/vyatta-show-protocols configured`)
- if [ ${#daemons} -eq 0 ]
+ local -a protocols=(`/opt/vyatta/bin/vyatta-show-protocols exists`)
+ if [ ${#protocols[*]} -eq 0 ]
then
# Only zebra: mode 1 simple restart
- args+=( -R "$0 zebra restart" )
+ args+=( -R "$0 zebra restart" zebra )
else
- # Many daemons: phased restart
+ # With routing protocols: phased restart
args+=(-A -r "$0 restart \%s" -s "$0 start \%s" -k "$0 stop \%s" );
+ args+=( zebra ${protocols[*]} )
fi
- args+=( zebra $daemons )
;;
esac
@@ -98,26 +98,26 @@ reload_config() {
trap "" EXIT HUP INT QUIT TERM
}
+update() {
+ local deleted=`/opt/vyatta/bin/vyatta-show-protocols deleted`
+ local added=`/opt/vyatta/bin/vyatta-show-protocols added`
-case "$1" in
- start) start $2;;
- stop) stop $2;;
+ # nothing lost, nothing gained
+ [ -z "$deleted" -a -z "$added" ] && exit 0
- update)
- deleted=`/opt/vyatta/bin/vyatta-show-protocols deleted`
- added=`/opt/vyatta/bin/vyatta-show-protocols added`
+ stop watchquagga
+ for daemon in $deleted
+ do stop ${daemon}
+ done
- # nothing lost, nothing gained
- [ -z "$deleted" -a -z "$added" ] && exit 0
+ start watchquagga
+}
- stop watchquagga
- for daemon in $deleted
- do stop ${daemon}
- done
-
- start watchquagga
- ;;
+case "$1" in
+ start) start $2;;
+ stop) stop $2;;
+ update) update;;
restart)
# Restart single daemon
stop $2