;;
stop)
- test -f $pazpar2_pid && kill `cat $pazpar2_pid`
+ test -f $pazpar2_pid && \
+ kill -0 `cat $pazpar2_pid` 2>/dev/null && \
+ kill -TERM `cat $pazpar2_pid`
;;
# graceful restart - not yet implemented by pazpar2
restart)
$0 stop
+ sleep 1 # let the OS give the port address free
$0 start "$@"
;;