CC-2166 Packaging improvements

Added command line options to the install process to overwrite or
preserve the existing config files.

Added the pypo-start/stop and recorder-start/stop symlinks to /usr/bin.

Renamed pypo-start.py to airtime-pypo-start.
Renamed pypo-stop.py to airtime-pypo-stop.
Renamed recorder-start.py to airtime-show-recorder-start.
Renamed recorder-stop.py to airtime-show-recorder-stop.

Renamed testrecordscript.py to recorder.py
This commit is contained in:
Paul Baranowski 2011-04-15 18:23:51 -04:00
parent 2b90008ef2
commit 173d82007f
14 changed files with 75 additions and 21 deletions

View file

@ -112,6 +112,12 @@ 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-pypo-start")
os.system("ln -s "+config["bin_dir"]+"/bin/airtime-pypo-start /usr/bin/")
os.system("rm -f /usr/bin/airtime-pypo-stop")
os.system("ln -s "+config["bin_dir"]+"/bin/airtime-pypo-stop /usr/bin/")
print "Installing pypo daemon"
create_path("/etc/service/pypo")
create_path("/etc/service/pypo/log")
@ -130,7 +136,7 @@ try:
print "Waiting for processes to start..."
time.sleep(5)
os.system("python %s/pypo-start.py" % (get_current_script_dir()))
os.system("python /usr/bin/airtime-pypo-start")
time.sleep(2)
found = True

View file

@ -1,19 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
if os.geteuid() != 0:
print "Please run this as root."
sys.exit(1)
try:
print "Starting daemontool script pypo"
os.system("svc -u /etc/service/pypo")
print "Starting daemontool script pypo-liquidsoap"
os.system("svc -u /etc/service/pypo-liquidsoap")
except Exception, e:
print "exception:" + str(e)

View file

@ -1,25 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
if os.geteuid() != 0:
print "Please run this as root."
sys.exit(1)
try:
print "Stopping daemontool script pypo"
os.system("svc -dx /etc/service/pypo 1>/dev/null 2>&1")
if os.path.exists("/etc/service/pypo-fetch"):
os.system("svc -dx /etc/service/pypo-fetch 1>/dev/null 2>&1")
if os.path.exists("/etc/service/pypo-push"):
os.system("svc -dx /etc/service/pypo-push 1>/dev/null 2>&1")
print "Stopping daemontool script pypo-liquidsoap"
os.system("svc -dx /etc/service/pypo-liquidsoap 1>/dev/null 2>&1")
os.system("killall liquidsoap")
except Exception, e:
print "exception:" + str(e)

View file

@ -37,7 +37,7 @@ try:
print 'Error loading config file: ', e
sys.exit()
os.system("python %s/pypo-stop.py" % get_current_script_dir())
os.system("python /usr/bin/airtime-pypo-stop")
print "Removing log directories"
remove_path(config["log_base_dir"])
@ -45,6 +45,10 @@ try:
print "Removing cache directories"
remove_path(config["cache_base_dir"])
print "Removing symlinks"
os.system("rm -f /usr/bin/airtime-pypo-start")
os.system("rm -f /usr/bin/airtime-pypo-stop")
print "Removing pypo files"
remove_path(config["bin_dir"])