Tons of bugfixes for the installer on Debian
* Still need to get pypo working with sysvinit * Still need to fix this logger.cfg silliness with pypo and media_monitor
This commit is contained in:
parent
d46f4a52eb
commit
bbcd4fbe2e
9 changed files with 79 additions and 21 deletions
18
python_apps/media-monitor/bin/airtime-media-monitor
Executable file → Normal file
18
python_apps/media-monitor/bin/airtime-media-monitor
Executable file → Normal file
|
@ -1,3 +1,17 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/python
|
||||
import logging
|
||||
import locale
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
import mm2.mm2 as mm2
|
||||
from std_err_override import LogWriter
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
|
||||
exec python -m media_monitor > /var/log/airtime/media-monitor/py-interpreter.log 2>&1
|
||||
def run():
|
||||
global_cfg = '/etc/airtime/airtime.conf'
|
||||
logging_cfg = os.path.join(os.path.dirname(__file__), 'logging.cfg')
|
||||
|
||||
mm2.main( global_cfg, logging_cfg )
|
||||
|
||||
run()
|
||||
|
|
|
@ -9,12 +9,26 @@
|
|||
# Short-Description: Manage airtime-media-monitor daemon
|
||||
### END INIT INFO
|
||||
|
||||
USERID=WEB_USER
|
||||
GROUPID=WEB_USER
|
||||
NAME=Airtime\ Media\ Monitor
|
||||
USERID=www-data
|
||||
GROUPID=www-data
|
||||
NAME=airtime-media-monitor
|
||||
|
||||
DAEMON=/usr/lib/airtime/media-monitor/airtime-media-monitor
|
||||
PIDFILE=/var/run/airtime/airtime-media-monitor.pid
|
||||
DAEMON=/usr/bin/$NAME
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
|
||||
# and status_of_proc is working.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
start () {
|
||||
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID \
|
||||
|
@ -48,8 +62,7 @@ case "${1:-''}" in
|
|||
echo "Done."
|
||||
;;
|
||||
'status')
|
||||
# status commands here
|
||||
/usr/bin/airtime-check-system
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
*) # no parameter specified
|
||||
echo "Usage: $SELF start|stop|restart|status"
|
||||
|
|
|
@ -60,5 +60,5 @@ setup(name='airtime-media-monitor',
|
|||
# Reload the initctl config so that the media-monitor service works
|
||||
if data_files:
|
||||
print "Reloading initctl configuration"
|
||||
call(['initctl', 'reload-configuration'])
|
||||
#call(['initctl', 'reload-configuration'])
|
||||
print "Run \"sudo service airtime-media-monitor start\""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue