fix installer breaking liquidsoap package install
This commit is contained in:
parent
f33485f8ea
commit
f8d63b70d8
1 changed files with 21 additions and 20 deletions
|
@ -23,15 +23,15 @@ def get_os_codename():
|
|||
try:
|
||||
p = Popen("which lsb_release > /dev/null", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
|
||||
if (sts == 0):
|
||||
#lsb_release is available on this system. Let's get the os codename
|
||||
p = Popen("lsb_release -sc", shell=True, stdout=PIPE)
|
||||
codename = p.communicate()[0].strip('\r\n')
|
||||
|
||||
|
||||
p = Popen("lsb_release -sd", shell=True, stdout=PIPE)
|
||||
fullname = p.communicate()[0].strip('\r\n')
|
||||
|
||||
|
||||
return (codename, fullname)
|
||||
except Exception, e:
|
||||
pass
|
||||
|
@ -58,7 +58,7 @@ def generate_liquidsoap_config(ss):
|
|||
fh.write(api_client.encode_to(buffer))
|
||||
fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"\n')
|
||||
fh.close()
|
||||
|
||||
|
||||
PATH_INI_FILE = '/etc/airtime/pypo.cfg'
|
||||
PATH_LIQUIDSOAP_BIN = '/usr/lib/airtime/pypo/bin/liquidsoap_bin'
|
||||
|
||||
|
@ -71,44 +71,45 @@ try:
|
|||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
|
||||
try:
|
||||
#select appropriate liquidsoap file for given system os/architecture
|
||||
architecture = platform.architecture()[0]
|
||||
arch = arch_map[architecture]
|
||||
|
||||
|
||||
print "* Detecting OS: ...",
|
||||
(codename, fullname) = get_os_codename()
|
||||
print " Found %s (%s) on %s architecture" % (fullname, codename, arch)
|
||||
|
||||
print " Found %s (%s) on %s architecture" % (fullname, codename, arch)
|
||||
|
||||
print " * Installing Liquidsoap binary"
|
||||
|
||||
|
||||
p = Popen("which liquidsoap", shell=True, stdout=PIPE)
|
||||
liq_path = p.communicate()[0].strip()
|
||||
|
||||
symlink_path = "/usr/bin/airtime-liquidsoap"
|
||||
|
||||
if p.returncode == 0:
|
||||
try:
|
||||
os.unlink(liq_path)
|
||||
os.unlink(symlink_path)
|
||||
except Exception:
|
||||
#liq_path DNE, which is OK.
|
||||
pass
|
||||
|
||||
|
||||
os.symlink(liq_path, "/usr/bin/airtime-liquidsoap")
|
||||
|
||||
|
||||
os.symlink(liq_path, symlink_path)
|
||||
else:
|
||||
print " * Liquidsoap binary not found!"
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
#initialize init.d scripts
|
||||
subprocess.call("update-rc.d airtime-playout defaults >/dev/null 2>&1", shell=True)
|
||||
|
||||
#clear out an previous pypo cache
|
||||
print "* Clearing previous pypo cache"
|
||||
print "* Clearing previous pypo cache"
|
||||
subprocess.call("rm -rf /var/tmp/airtime/pypo/cache/scheduler/* >/dev/null 2>&1", shell=True)
|
||||
|
||||
|
||||
if "airtime_service_start" in os.environ and os.environ["airtime_service_start"] == "t":
|
||||
print "* Waiting for pypo processes to start..."
|
||||
print "* Waiting for pypo processes to start..."
|
||||
subprocess.call("invoke-rc.d airtime-playout start-no-monit > /dev/null 2>&1", shell=True)
|
||||
|
||||
|
||||
except Exception, e:
|
||||
print e
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue