Major reorganization of the pypo directory.
Much better organization of files into packages
This commit is contained in:
parent
f4d313a67c
commit
1c87d51b8e
20 changed files with 16 additions and 15 deletions
83
python_apps/pypo/install/airtime-playout-init-d
Executable file
83
python_apps/pypo/install/airtime-playout-init-d
Executable file
|
@ -0,0 +1,83 @@
|
|||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: airtime-playout
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Manage airtime-playout daemon
|
||||
### END INIT INFO
|
||||
|
||||
USERID=root
|
||||
NAME="Airtime Scheduler"
|
||||
|
||||
DAEMON=/usr/lib/airtime/pypo/bin/airtime-playout
|
||||
PIDFILE=/var/run/airtime-playout.pid
|
||||
|
||||
start () {
|
||||
mkdir -p /var/log/airtime/pypo
|
||||
|
||||
start-stop-daemon --start --background --quiet --chuid $USERID:$USERID \
|
||||
--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
|
||||
}
|
||||
|
||||
start_with_monit() {
|
||||
start
|
||||
monit monitor airtime-playout >/dev/null 2>&1
|
||||
}
|
||||
|
||||
stop_with_monit() {
|
||||
monit unmonitor airtime-playout >/dev/null 2>&1
|
||||
stop
|
||||
}
|
||||
|
||||
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."
|
||||
;;
|
||||
'start-with-monit')
|
||||
# restart commands here
|
||||
echo -n "Starting $NAME: "
|
||||
start_with_monit
|
||||
echo "Done."
|
||||
;;
|
||||
'stop-with-monit')
|
||||
# restart commands here
|
||||
echo -n "Stopping $NAME: "
|
||||
stop_with_monit
|
||||
echo "Done."
|
||||
;;
|
||||
|
||||
'status')
|
||||
# status commands here
|
||||
/usr/bin/airtime-check-system
|
||||
;;
|
||||
*) # no parameter specified
|
||||
echo "Usage: $SELF start|stop|restart|status"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue