cc-2055: switch to init.d

-fix uninstall scripts
-make daemon script for media-monitor and show-recorder
-create pid file for liquidsoap
-fix airtime-check-system
-make sure all startup scripts are using exec
This commit is contained in:
martin 2011-05-31 18:55:22 -04:00
parent 79e24e5af5
commit 079d9d36b0
14 changed files with 192 additions and 98 deletions

View file

@ -0,0 +1,49 @@
#!/bin/bash
USERID=pypo
GROUPID=pypo
NAME=Airtime
DAEMON=/usr/bin/airtime-show-recorder
PIDFILE=/var/run/airtime-show-recorder.pid
start () {
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE --startas $DAEMON
}
stop () {
# Send TERM after 5 seconds, wait at most 30 seconds.
start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE
rm -f $PIDFILE
}
case "${1:-''}" in
'start')
# start commands here
echo -n "Starting $NAME: "
start
echo "Done."
;;
'stop')
# stop commands here
echo -n "Stopping $NAME: "
stop
echo "Done."
;;
'restart')
# restart commands here
echo -n "Restarting $NAME: "
stop
start
echo "Done."
;;
'status')
# status commands here
/usr/bin/airtime-check-system
;;
*) # no parameter specified
echo "Usage: $SELF start|stop|restart|status"
exit 1
;;
esac