summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-08 10:59:56 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-08 10:59:56 -0700
commit8215c3e1b25cd84701160459b9b46219af6a4eff (patch)
tree7a7315779e905697b21c136dcc6cbbfac249030c /scripts
parent7cdfc68e8cdf0893ffc0b611470c60d63bd08c4b (diff)
downloadvyatta-cfg-quagga-8215c3e1b25cd84701160459b9b46219af6a4eff.tar.gz
vyatta-cfg-quagga-8215c3e1b25cd84701160459b9b46219af6a4eff.zip
Handle multiple requests to start same daemon
Templates will ask to start already running daemon, this is okay.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/quagga-manager16
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/quagga-manager b/scripts/quagga-manager
index 383616e0..85bfec98 100755
--- a/scripts/quagga-manager
+++ b/scripts/quagga-manager
@@ -42,26 +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 )
+ 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() {