CC-4017: Run airtime-playour process as root user
-Done
This commit is contained in:
parent
7e7f8147da
commit
a6eb74b1fd
2 changed files with 27 additions and 21 deletions
|
@ -10,6 +10,7 @@
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
USERID=pypo
|
USERID=pypo
|
||||||
|
ROOTUSERID=root
|
||||||
GROUPID=pypo
|
GROUPID=pypo
|
||||||
NAME=Airtime\ Playout
|
NAME=Airtime\ Playout
|
||||||
|
|
||||||
|
@ -47,7 +48,7 @@ start () {
|
||||||
chown pypo:pypo /etc/airtime
|
chown pypo:pypo /etc/airtime
|
||||||
chown pypo:pypo /etc/airtime/liquidsoap.cfg
|
chown pypo:pypo /etc/airtime/liquidsoap.cfg
|
||||||
|
|
||||||
start-stop-daemon --start --background --quiet --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
|
start-stop-daemon --start --background --quiet --chuid $ROOTUSERID:$ROOTUSERID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
|
||||||
monit monitor airtime-playout >/dev/null 2>&1
|
monit monitor airtime-playout >/dev/null 2>&1
|
||||||
|
|
||||||
liquidsoap_start
|
liquidsoap_start
|
||||||
|
@ -80,7 +81,7 @@ monit_restart() {
|
||||||
}
|
}
|
||||||
|
|
||||||
start_no_monit() {
|
start_no_monit() {
|
||||||
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
|
start-stop-daemon --start --background --quiet --chuid $ROOTUSERID:$ROOTUSERID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
|
||||||
liquidsoap_start
|
liquidsoap_start
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import logging.config
|
||||||
import shutil
|
import shutil
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import stat
|
||||||
|
|
||||||
from std_err_override import LogWriter
|
from std_err_override import LogWriter
|
||||||
|
|
||||||
|
@ -74,8 +75,12 @@ class PypoFile(Thread):
|
||||||
copy will overwrite dst if it already exists
|
copy will overwrite dst if it already exists
|
||||||
"""
|
"""
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
|
||||||
|
#make file world readable
|
||||||
|
os.chmod(dst, stat.S_IRUSR | stat.S_IRGRP | stat.S_IXOTH)
|
||||||
|
except Exception, e:
|
||||||
self.logger.error("Could not copy from %s to %s" % (src, dst))
|
self.logger.error("Could not copy from %s to %s" % (src, dst))
|
||||||
|
self.logger.error(e)
|
||||||
|
|
||||||
def get_highest_priority_media_item(self, schedule):
|
def get_highest_priority_media_item(self, schedule):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue