blob: 3d2bbd8221133fa135dc183c578acff8595305cb [file] [log] [blame]
#!/bin/sh
# State Manager init script.
. /etc/utils.sh
APP="statemanager"
BINARY="/app/spacecast/statemanager"
FLAGS="-logtostderr"
running() {
[ -n "$(pgrep -f "$BINARY")" ]
}
case "$1" in
start)
if running; then
echo "State Manager is already running!"
else
babysit_start 10 "$APP" "$BINARY" "$FLAGS"
fi
;;
stop)
pkill -f "$BINARY"
;;
restart|reload)
$0 stop;$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac