Merge branch 'master' of dev.sourcefabric.org:campcaster
This commit is contained in:
commit
909e37934f
|
@ -1,12 +1,9 @@
|
|||
#!/bin/sh
|
||||
ls_user="pypo"
|
||||
export HOME="/home/pypo/"
|
||||
#ls_path="/usr/local/bin/liquidsoap"
|
||||
ls_path="/opt/pypo/bin/liquidsoap/liquidsoap"
|
||||
ls_param="/opt/pypo/bin/scripts/ls_script.liq"
|
||||
echo "*** Daemontools: starting liquidsoap"
|
||||
echo "cp /opt/pypo/files/basic/silence.lsp /opt/pypo/cache/current.lsp"
|
||||
cp /opt/pypo/files/basic/silence.lsp /opt/pypo/cache/current.lsp
|
||||
exec 2>&1
|
||||
echo "exec sudo -u ${ls_user} ${ls_path} ${ls_param} "
|
||||
cd /opt/pypo/bin/scripts && sudo -u ${ls_user} ${ls_path} ${ls_param}
|
||||
|
|
|
@ -55,6 +55,11 @@ def copy_dir(src_dir, dest_dir):
|
|||
shutil.copytree(src_dir, dest_dir)
|
||||
|
||||
try:
|
||||
|
||||
print "Terminating any existing pypo processes"
|
||||
os.system("python ./pypo-stop.py")
|
||||
time.sleep(5)
|
||||
|
||||
# Create users
|
||||
create_user("pypo")
|
||||
|
||||
|
@ -75,7 +80,6 @@ try:
|
|||
|
||||
print "Copying pypo files"
|
||||
shutil.copy("../scripts/silence.mp3", BASE_PATH+"files/basic")
|
||||
shutil.copy("../scripts/silence-playlist.lsp", BASE_PATH+"files/basic")
|
||||
|
||||
if platform.architecture()[0] == '64bit':
|
||||
print "Installing 64-bit liquidsoap binary"
|
||||
|
@ -110,7 +114,6 @@ try:
|
|||
os.system("chown -R pypo:pypo /etc/service/pypo-push")
|
||||
|
||||
print "Installing daemontool script pypo-liquidsoap"
|
||||
os.system("svc -dx /etc/service/pypo-liquidsoap 1>/dev/null 2>&1")
|
||||
create_path("/etc/service/pypo-liquidsoap")
|
||||
create_path("/etc/service/pypo-liquidsoap/log")
|
||||
shutil.copy("pypo-daemontools-liquidsoap.sh", "/etc/service/pypo-liquidsoap/run")
|
||||
|
@ -120,15 +123,15 @@ try:
|
|||
|
||||
print "Waiting for processes to start..."
|
||||
time.sleep(5)
|
||||
os.system("killall liquidsoap")
|
||||
os.system("python ./pypo-start.py")
|
||||
time.sleep(2)
|
||||
|
||||
found = True
|
||||
|
||||
p = Popen('svstat /etc/service/pypo-fetch', shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
||||
output = p.stdout.read()
|
||||
if (output.find("unable to open supervise/ok: file does not exist") >= 0):
|
||||
print "Install has completed, but daemontools is not running, please make sure you have it installed and then reboot."
|
||||
sys.exit()
|
||||
found = False
|
||||
print output
|
||||
|
||||
p = Popen('svstat /etc/service/pypo-push', shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
||||
|
@ -138,8 +141,11 @@ try:
|
|||
p = Popen('svstat /etc/service/pypo-liquidsoap', shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
||||
output = p.stdout.read()
|
||||
print output
|
||||
|
||||
print "Install complete."
|
||||
|
||||
if not found:
|
||||
print "Install has completed, but daemontools is not running, please make sure you have it installed and then reboot."
|
||||
else:
|
||||
print "Install complete."
|
||||
except Exception, e:
|
||||
print "exception:" + str(e)
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ if os.geteuid() != 0:
|
|||
|
||||
try:
|
||||
print "Starting daemontool script pypo-fetch"
|
||||
os.system("svc -t /etc/service/pypo-fetch")
|
||||
os.system("svc -u /etc/service/pypo-fetch")
|
||||
|
||||
print "Starting daemontool script pypo-push"
|
||||
os.system("svc -t /etc/service/pypo-push")
|
||||
os.system("svc -u /etc/service/pypo-push")
|
||||
|
||||
print "Starting daemontool script pypo-liquidsoap"
|
||||
os.system("svc -t /etc/service/pypo-liquidsoap")
|
||||
os.system("svc -u /etc/service/pypo-liquidsoap")
|
||||
|
||||
except Exception, e:
|
||||
print "exception:" + str(e)
|
||||
|
|
|
@ -10,13 +10,13 @@ if os.geteuid() != 0:
|
|||
|
||||
try:
|
||||
print "Stopping daemontool script pypo-fetch"
|
||||
os.system("svc -dx /etc/service/pypo-fetch")
|
||||
os.system("svc -dx /etc/service/pypo-fetch 2>/dev/null")
|
||||
|
||||
print "Stopping daemontool script pypo-push"
|
||||
os.system("svc -dx /etc/service/pypo-push")
|
||||
os.system("svc -dx /etc/service/pypo-push 2>/dev/null")
|
||||
|
||||
print "Stopping daemontool script pypo-liquidsoap"
|
||||
os.system("svc -dx /etc/service/pypo-liquidsoap")
|
||||
os.system("svc -dx /etc/service/pypo-liquidsoap 2>/dev/null")
|
||||
|
||||
except Exception, e:
|
||||
print "exception:" + str(e)
|
||||
print "exception:" + str(e)
|
||||
|
|
Loading…
Reference in New Issue