More work on media-monitor and pypo install process
This commit is contained in:
parent
6d38f2ccfc
commit
75c2a4a18b
10 changed files with 40 additions and 281 deletions
|
@ -1,30 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Location of pypo_cli.py Python script
|
||||
|
||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||
. ${virtualenv_bin}activate
|
||||
|
||||
media_monitor_path="/usr/lib/airtime/media-monitor/"
|
||||
media_monitor_script="media_monitor.py"
|
||||
|
||||
api_client_path="/usr/lib/airtime/:/usr/lib/airtime/media-monitor/mm2/"
|
||||
|
||||
cd ${media_monitor_path}
|
||||
|
||||
exec 2>&1
|
||||
|
||||
set +e
|
||||
cat /etc/default/locale | grep -i "LANG=.*UTF-\?8"
|
||||
set -e
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "non UTF-8 default locale found in /etc/default/locale." > /var/log/airtime/media-monitor/error.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export PYTHONPATH=${api_client_path}
|
||||
export LC_ALL=`cat /etc/default/locale | grep "LANG=" | cut -d= -f2 | tr -d "\n\""`
|
||||
|
||||
exec python ${media_monitor_path}${media_monitor_script} > /var/log/airtime/media-monitor/py-interpreter.log 2>&1
|
||||
|
||||
# EOF
|
|
@ -27,17 +27,6 @@ stop () {
|
|||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
start_with_monit() {
|
||||
start
|
||||
monit monitor airtime-media-monitor >/dev/null 2>&1
|
||||
}
|
||||
|
||||
stop_with_monit() {
|
||||
monit unmonitor airtime-media-monitor >/dev/null 2>&1
|
||||
stop
|
||||
}
|
||||
|
||||
|
||||
case "${1:-''}" in
|
||||
'start')
|
||||
# start commands here
|
||||
|
@ -58,18 +47,6 @@ case "${1:-''}" in
|
|||
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
|
||||
|
|
|
@ -40,7 +40,7 @@ setup(name='airtime-media-monitor',
|
|||
zip_safe=False,
|
||||
data_files=data_files)
|
||||
|
||||
# Reload the initctl config so that playout services works
|
||||
# Reload the initctl config so that the media-monitor service works
|
||||
if data_files:
|
||||
print "Reloading initctl configuration"
|
||||
call(['initctl', 'reload-configuration'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue