Skip to content

Commit

Permalink
Add condrestart/try-restart to sysv init script
Browse files Browse the repository at this point in the history
systemd has this naturally
  • Loading branch information
jsoref committed Jul 4, 2018
1 parent 9d57acc commit e0ec05c
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ stop() {
fi
}

restart() {
stop && start
}

status() {
if [ -f "$pidfile" ] ; then
pid=$(cat "$pidfile")
Expand Down Expand Up @@ -118,7 +122,7 @@ force_stop() {


case "$1" in
force-start|start|stop|force-stop|restart)
force-start|start|stop|force-stop|condrestart|try-restart|restart)
trace "Attempting '$1' on kibana"
;;
esac
Expand Down Expand Up @@ -151,9 +155,15 @@ case "$1" in
fi
exit $code
;;
condrestart|try-restart)
status
code=$?
if [ $code -eq 0 ] ; then
restart
fi
;;
restart)

stop && start
restart
;;
*)
echo "Usage: $SCRIPTNAME {start|force-start|stop|force-start|force-stop|status|restart}" >&2
Expand Down

0 comments on commit e0ec05c

Please sign in to comment.