Started adding the scripts to automatically run the scheduler at startup.
This commit is contained in:
parent
3c12256cb8
commit
a255fc4508
|
@ -36,6 +36,7 @@ try:
|
|||
#os.mkdirs("/var/log/liquidsoap")
|
||||
#os.system("chown -R liquidsoap:liquidsoap /var/log/liquidsoap")
|
||||
create_path("/opt/pypo")
|
||||
create_path("/opt/pypo/bin")
|
||||
create_path("/opt/pypo/cache")
|
||||
create_path("/opt/pypo/files")
|
||||
create_path("/opt/pypo/files/basic")
|
||||
|
@ -44,6 +45,11 @@ try:
|
|||
create_path("/opt/pypo/archive")
|
||||
os.system("chmod -R 755 /opt/pypo/")
|
||||
os.system("chown -R pypo:pypo /opt/pypo")
|
||||
|
||||
shutil.copy("../pypo/scripts/silence-playlist.lsp", "/opt/pypo/files/basic")
|
||||
shutil.copy("../pypo/scripts/silence.mp3", "/opt/pypo/files/basic")
|
||||
shutil.copy("../pypo/pypo-cli.py", "/opt/pypo/bin")
|
||||
|
||||
except Exception, e:
|
||||
print "exception:" + str(e)
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
ls_user="pypo"
|
||||
export HOME="/home/pypo/"
|
||||
ls_path="/usr/local/bin/liquidsoap"
|
||||
ls_param="/opt/pypo/bin/scripts/ls_script.liq"
|
||||
echo "*** Daemontools: starting liquidsoap"
|
||||
cp /opt/pypo/files/basic/silence.lsp /opt/pypo/cache/current.lsp
|
||||
exec 2>&1
|
||||
exec sudo -u ${ls_user} ${ls_path} ${ls_param}
|
||||
# EOF
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
pypo_user="pypo"
|
||||
export HOME="/home/pypo/"
|
||||
# Location of pypo_cli.py Python script
|
||||
pypo_path="/opt/pypo/bin"
|
||||
pypo_script="pypo_cli.py"
|
||||
# note the -u when calling python! we need it to get unbuffered binary stdout and stderr
|
||||
echo "*** Daemontools: starting daemon"
|
||||
cd ${pypo_path}
|
||||
exec 2>&1
|
||||
exec setuidgid ${pypo_user} \
|
||||
python -u ${pypo_path}${pypo_script} \
|
||||
-f
|
||||
# EOF
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
pypo_user="pypo"
|
||||
export HOME="/home/pypo/"
|
||||
# Location of pypo_cli.py Python script
|
||||
pypo_path="/opt/pypo/bin"
|
||||
pypo_script="pypo_cli.py"
|
||||
# note the -u when calling python! we need it to get unbuffered binary stdout and stderr
|
||||
echo "*** Daemontools: starting daemon"
|
||||
cd ${pypo_path}
|
||||
exec 2>&1
|
||||
exec setuidgid ${pypo_user} \
|
||||
python -u ${pypo_path}${pypo_script} \
|
||||
-p
|
||||
# EOF
|
|
@ -2,8 +2,7 @@
|
|||
# liquidsoap config file #
|
||||
###########################################
|
||||
|
||||
# this file is specific to the obp
|
||||
# installation. eg it assumes that there are
|
||||
# This config assumes that there are
|
||||
# two instances of LS running
|
||||
# the "scheduler" & the "fallback" instance
|
||||
|
||||
|
@ -12,12 +11,11 @@
|
|||
# general settings #
|
||||
###########################################
|
||||
|
||||
log_file = "/var/log/obp/ls/<script>.log"
|
||||
log_file = "/var/log/pypo/<script>.log"
|
||||
log_level = 5
|
||||
|
||||
# archive directory
|
||||
archive_dir = "/storage/pypo/archive/"
|
||||
|
||||
archive_dir = "/opt/pypo/archive/"
|
||||
|
||||
# list pointing to the current couchcaster mountpoint
|
||||
couchcaster_list = "http://stage.openbroadcast.ch/mod/ml/api/pypo/current_couchcaster"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# export home dir
|
||||
export HOME=/home/liquidsoap/
|
||||
#export HOME=/home/pypo/
|
||||
|
||||
# start liquidsoap with corresponding user & scrupt
|
||||
sudo -u liquidsoap /usr/local/bin/liquidsoap ls_script.liq
|
||||
sudo -u pypo /usr/local/bin/liquidsoap ls_script.liq
|
||||
|
|
Loading…
Reference in New Issue