Fix spew on stopping a dead service
This commit is contained in:
parent
5abed1f219
commit
bcf9c80efb
@ -132,7 +132,10 @@ fsstop() {
|
|||||||
# Stop a running service by name
|
# Stop a running service by name
|
||||||
for service in $@; do
|
for service in $@; do
|
||||||
pidfile="$_optrundir"/"$service".pid
|
pidfile="$_optrundir"/"$service".pid
|
||||||
[ -f "$pidfile" ] || warn "Service is not already running: $service"
|
if ! [ -f "$pidfile" ]; then
|
||||||
|
warn "Service is not already running: $service"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
pid="$(< $pidfile)"
|
pid="$(< $pidfile)"
|
||||||
[ "$pid" -gt 0 ] 2> /dev/null || error "PID is invalid for service: $service (PID $pid)" 51
|
[ "$pid" -gt 0 ] 2> /dev/null || error "PID is invalid for service: $service (PID $pid)" 51
|
||||||
[ -d "/proc/$pid" ] || warn "Service is already dead: $service"
|
[ -d "/proc/$pid" ] || warn "Service is already dead: $service"
|
||||||
|
Loading…
Reference in New Issue
Block a user