cc-2055: switch to init.d

-Change all python apps to log directly to file
-change airtime-pypo to airtime-playback
-fix airtime install started/completed message bumpers
This commit is contained in:
martin 2011-05-31 16:05:48 -04:00
parent c05c2f1e28
commit 79e24e5af5
26 changed files with 75 additions and 269 deletions

View file

@ -1,15 +0,0 @@
#!/bin/sh
ls_user="pypo"
export HOME="/var/tmp/airtime/pypo/"
api_client_path="/usr/lib/airtime/pypo/"
ls_path="/usr/lib/airtime/pypo/bin/liquidsoap/liquidsoap"
ls_param="/usr/lib/airtime/pypo/bin/scripts/ls_script.liq"
echo "*** Daemontools: starting liquidsoap"
exec 2>&1
cd /usr/lib/airtime/pypo/bin/scripts
export PYTHONPATH=${api_client_path}
exec ${ls_path} ${ls_param}
# EOF

View file

@ -1,2 +0,0 @@
#!/bin/sh
exec setuidgid pypo multilog t /var/log/airtime/pypo/main

View file

@ -1,17 +0,0 @@
#!/bin/sh
pypo_user="pypo"
export HOME="/var/tmp/airtime/pypo/"
# Location of pypo_cli.py Python script
pypo_path="/usr/lib/airtime/pypo/bin/"
api_client_path="/usr/lib/airtime/pypo/"
pypo_script="pypo-cli.py"
echo "*** Daemontools: starting daemon"
cd ${pypo_path}
exec 2>&1
PYTHONPATH=${api_client_path}:$PYTHONPATH
export PYTHONPATH
# Note the -u when calling python! we need it to get unbuffered binary stdout and stderr
exec python -u ${pypo_path}${pypo_script}
# EOF

View file

@ -136,46 +136,18 @@ try:
os.system("chown -R pypo:pypo "+config["bin_dir"])
os.system("chown -R pypo:pypo "+config["cache_base_dir"])
"""
print "Creating symbolic links"
os.system("rm -f /usr/bin/airtime-playout-start")
os.system("ln -s "+config["bin_dir"]+"/bin/airtime-playout-start /usr/bin/")
os.system("rm -f /usr/bin/airtime-playout-stop")
os.system("ln -s "+config["bin_dir"]+"/bin/airtime-playout-stop /usr/bin/")
"""
print "Creating symbolic links"
os.system("rm -f /usr/bin/airtime-pypo")
os.system("ln -s "+config["bin_dir"]+"/bin/airtime-pypo /usr/bin/")
os.system("rm -f /usr/bin/airtime-playout")
os.system("ln -s "+config["bin_dir"]+"/bin/airtime-playout /usr/bin/")
os.system("rm -f /usr/bin/airtime-liquidsoap")
os.system("ln -s "+config["bin_dir"]+"/bin/airtime-liquidsoap /usr/bin/")
print "Installing pypo daemon"
shutil.copy(config["bin_dir"]+"/bin/airtime-pypo-init-d", "/etc/init.d/airtime-pypo")
shutil.copy(config["bin_dir"]+"/bin/airtime-playout-init-d", "/etc/init.d/airtime-playout")
"""
create_path("/etc/service/pypo")
create_path("/etc/service/pypo/log")
shutil.copy("%s/pypo-daemontools.sh"%current_script_dir, "/etc/service/pypo/run")
shutil.copy("%s/pypo-daemontools-logger.sh"%current_script_dir, "/etc/service/pypo/log/run")
os.system("chmod -R 755 /etc/service/pypo")
os.system("chown -R pypo:pypo /etc/service/pypo")
"""
"""
print "Installing liquidsoap daemon"
create_path("/etc/service/pypo-liquidsoap")
create_path("/etc/service/pypo-liquidsoap/log")
shutil.copy("%s/pypo-daemontools-liquidsoap.sh"%current_script_dir, "/etc/service/pypo-liquidsoap/run")
shutil.copy("%s/pypo-liquidsoap-daemontools-logger.sh"%current_script_dir, "/etc/service/pypo-liquidsoap/log/run")
os.system("chmod -R 755 /etc/service/pypo-liquidsoap")
os.system("chown -R pypo:pypo /etc/service/pypo-liquidsoap")
"""
print "Waiting for processes to start..."
p = Popen("/etc/init.d/airtime-pypo start", shell=True)
p = Popen("/etc/init.d/airtime-playout start", shell=True)
sts = os.waitpid(p.pid, 0)[1]
except Exception, e:

View file

@ -1,2 +0,0 @@
#!/bin/sh
exec setuidgid pypo multilog t /var/log/airtime/pypo-liquidsoap/main