summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-08 11:00:42 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-08 11:00:42 -0700
commitb19c0fb291542882a3b6a2ace364dedeba60cb0c (patch)
treea5f8db01dc6173d8a602f8c1902b03633e8799a2
parent9bee2136abd26bd68ff810119a2d91fcdb45e2e5 (diff)
parent8215c3e1b25cd84701160459b9b46219af6a4eff (diff)
downloadvyatta-cfg-quagga-b19c0fb291542882a3b6a2ace364dedeba60cb0c.tar.gz
vyatta-cfg-quagga-b19c0fb291542882a3b6a2ace364dedeba60cb0c.zip
Merge branch 'jenner' of 192.168.100.1:git/vyatta-cfg-quagga into jenner
-rwxr-xr-xscripts/quagga-manager40
1 files changed, 10 insertions, 30 deletions
diff --git a/scripts/quagga-manager b/scripts/quagga-manager
index ba95d5f8..85bfec98 100755
--- a/scripts/quagga-manager
+++ b/scripts/quagga-manager
@@ -42,44 +42,24 @@ start() {
return 1
fi
- # already running?
- pidofproc $pidfile $daemon >/dev/null && return 0
-
- local -a args=( -d -P 0 -i ${pid_dir}/${daemon}.pid )
- case $daemon in
- zebra) args+=( -l -S -s 1048576 ) ;;
- watchquagga)
- args=( -dz -p ${pid_dir}/${daemon}.pid );
- # Note: at present ospf/rip only monitored if actually active
- # probably should get smarter in future here
- local -a protocols=(`/opt/vyatta/bin/vyatta-show-protocols exists`)
-
- if [ ${#protocols[*]} -eq 0 ]
- then
- # Only zebra: mode 1 simple restart
- args+=( -R "$0 restart zebra" zebra )
- else
- # With routing protocols: phased restart
- args+=( -A -r "$0 restart %s" )
- args+=( -s "$0 reload %s" )
- args+=( -k "$0 stop %s" )
- args+=( zebra ${protocols[*]} )
- fi
- ;;
- esac
+ local -a args=( -d -P 0 -i $pidfile )
+ if [ "$daemon" = "zebra" ]; then
+ args+=( -l -S -s 1048576 )
+ fi
- start-stop-daemon --start --quiet \
- --chdir $log_dir --exec $binpath \
- -- "${args[@]}"
+ exec start-stop-daemon --start --oknodo --quiet --name $daemon \
+ --chdir $log_dir --exec $binpath --pidfile $pidfile \
+ -- ${args[@]}
}
stop() {
local daemon=$1
+ local pidfile=${pid_dir}/${daemon}.pid
local binpath=/usr/sbin/vyatta-$daemon
start-stop-daemon --stop --quiet --oknodo --retry 5 \
- --exec $binpath --pidfile=$pid_dir/${daemon}.pid
- rm -f $pid_dir/${daemon}.pid
+ --name $daemon --exec $binpath --pidfile=$pidfile
+ rm -f $pidfile
}
get_protocol() {