CC-3575: Use invoke-rc.d to start and stop services, rather than calling init scripts directly

-done
This commit is contained in:
Martin Konecny 2012-04-05 20:42:15 -04:00
parent d9d8211a3b
commit 60d521a88a
8 changed files with 12 additions and 24 deletions

View file

@ -117,17 +117,8 @@ try:
#restart airtime-playout
print "* Waiting for pypo processes to start..."
"""
if os.environ["liquidsoap_keep_alive"] == "f":
print " * Restarting any previous Liquidsoap instances"
p = Popen("/etc/init.d/airtime-playout stop > /dev/null 2>&1", shell=True)
sts = os.waitpid(p.pid, 0)[1]
else:
print " * Keeping any previous Liquidsoap instances running"
p = Popen("/etc/init.d/airtime-playout pypo-stop > /dev/null 2>&1", shell=True)
sts = os.waitpid(p.pid, 0)[1]
"""
p = Popen("/etc/init.d/airtime-playout start-no-monit > /dev/null 2>&1", shell=True)
p = Popen("invoke-rc.d airtime-playout start-no-monit > /dev/null 2>&1", shell=True)
sts = os.waitpid(p.pid, 0)[1]
except Exception, e:

View file

@ -10,7 +10,7 @@ try:
#stop pypo and liquidsoap processes
print "Waiting for pypo processes to stop...",
if (os.path.exists('/etc/init.d/airtime-playout')):
p = Popen("/etc/init.d/airtime-playout stop", shell=True)
p = Popen("invoke-rc.d airtime-playout stop", shell=True)
sts = os.waitpid(p.pid, 0)[1]
print "OK"
else:

View file

@ -30,7 +30,7 @@ try:
print 'Error loading config file: ', e
sys.exit(1)
os.system("/etc/init.d/airtime-playout stop")
os.system("invoke-rc.d airtime-playout stop")
os.system("rm -f /etc/init.d/airtime-playout")
os.system("update-rc.d -f airtime-playout remove >/dev/null 2>&1")