mirror of
https://github.com/RobotechLille/cdf2018-principal
synced 2024-11-15 04:46:06 +01:00
39 lines
497 B
Plaintext
39 lines
497 B
Plaintext
|
#!/bin/sh
|
||
|
#
|
||
|
# Start main program
|
||
|
#
|
||
|
|
||
|
EXEC=$(which sh)
|
||
|
PIDFILE=/var/run/chef.pid
|
||
|
LOGFILE=/var/run/chef.log
|
||
|
|
||
|
start() {
|
||
|
printf "Starting chef: "
|
||
|
start-stop-daemon -p "$PIDFILE" -x "$EXEC" -b -m -S -- "/opt/chef/run.sh" -l "$LOGFILE"
|
||
|
echo "OK"
|
||
|
}
|
||
|
|
||
|
stop() {
|
||
|
printf "Stopping chef: "
|
||
|
start-stop-daemon -p "$PIDFILE" -x "$EXEC" -K
|
||
|
echo "OK"
|
||
|
}
|
||
|
|
||
|
case "$1" in
|
||
|
start)
|
||
|
start
|
||
|
;;
|
||
|
stop)
|
||
|
stop
|
||
|
;;
|
||
|
restart|reload)
|
||
|
stop
|
||
|
start
|
||
|
;;
|
||
|
*)
|
||
|
echo "Usage: $0 {start|stop|restart}"
|
||
|
exit 1
|
||
|
esac
|
||
|
|
||
|
exit $?
|