CC-3575: Use invoke-rc.d to start and stop services, rather than calling init scripts directly
-done
This commit is contained in:
parent
d9d8211a3b
commit
60d521a88a
|
@ -126,13 +126,13 @@ fi
|
||||||
#We don't want any of our python services running if we are doing an upgrade/reinstall.
|
#We don't want any of our python services running if we are doing an upgrade/reinstall.
|
||||||
#They will be automatically restarted later on.
|
#They will be automatically restarted later on.
|
||||||
if [ -e /etc/init.d/airtime-media-monitor ]; then
|
if [ -e /etc/init.d/airtime-media-monitor ]; then
|
||||||
/etc/init.d/airtime-media-monitor stop > /dev/null 2>&1
|
invoke-rc.d airtime-media-monitor stop > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
if [ -e /etc/init.d/airtime-playout ]; then
|
if [ -e /etc/init.d/airtime-playout ]; then
|
||||||
/etc/init.d/airtime-playout stop > /dev/null 2>&1
|
invoke-rc.d airtime-playout stop > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
if [ -e /etc/init.d/airtime-show-recorder ]; then
|
if [ -e /etc/init.d/airtime-show-recorder ]; then
|
||||||
/etc/init.d/airtime-show-recorder stop > /dev/null 2>&1
|
invoke-rc.d airtime-show-recorder stop > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ fi
|
||||||
# so we can ensure they can register with monit to monitor them when they start.
|
# so we can ensure they can register with monit to monitor them when they start.
|
||||||
# If monit is already running, this step is still useful as we need monit to
|
# If monit is already running, this step is still useful as we need monit to
|
||||||
# reload its config files.
|
# reload its config files.
|
||||||
/etc/init.d/monit restart
|
invoke-rc.d monit restart
|
||||||
|
|
||||||
#give monit some time to boot-up before issuing commands
|
#give monit some time to boot-up before issuing commands
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
|
@ -14,11 +14,8 @@ try:
|
||||||
|
|
||||||
#Start media-monitor daemon
|
#Start media-monitor daemon
|
||||||
print "* Waiting for media-monitor processes to start..."
|
print "* Waiting for media-monitor processes to start..."
|
||||||
"""
|
|
||||||
p = Popen("/etc/init.d/airtime-media-monitor stop", shell=True)
|
p = Popen("invoke-rc.d airtime-media-monitor start-no-monit", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
|
||||||
"""
|
|
||||||
p = Popen("/etc/init.d/airtime-media-monitor start-no-monit", shell=True)
|
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print e
|
print e
|
||||||
|
|
|
@ -9,7 +9,7 @@ if os.geteuid() != 0:
|
||||||
try:
|
try:
|
||||||
print "Waiting for media-monitor processes to stop...",
|
print "Waiting for media-monitor processes to stop...",
|
||||||
if (os.path.exists('/etc/init.d/airtime-media-monitor')):
|
if (os.path.exists('/etc/init.d/airtime-media-monitor')):
|
||||||
p = Popen("/etc/init.d/airtime-media-monitor stop", shell=True)
|
p = Popen("invoke-rc.d airtime-media-monitor stop", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
print "OK"
|
print "OK"
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -29,7 +29,7 @@ try:
|
||||||
print 'Error loading config file: ', e
|
print 'Error loading config file: ', e
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
os.system("/etc/init.d/airtime-media-monitor stop")
|
os.system("invoke-rc.d airtime-media-monitor stop")
|
||||||
os.system("rm -f /etc/init.d/airtime-media-monitor")
|
os.system("rm -f /etc/init.d/airtime-media-monitor")
|
||||||
os.system("update-rc.d -f airtime-media-monitor remove >/dev/null 2>&1")
|
os.system("update-rc.d -f airtime-media-monitor remove >/dev/null 2>&1")
|
||||||
|
|
||||||
|
|
|
@ -117,17 +117,8 @@ try:
|
||||||
|
|
||||||
#restart airtime-playout
|
#restart airtime-playout
|
||||||
print "* Waiting for pypo processes to start..."
|
print "* Waiting for pypo processes to start..."
|
||||||
"""
|
|
||||||
if os.environ["liquidsoap_keep_alive"] == "f":
|
p = Popen("invoke-rc.d airtime-playout start-no-monit > /dev/null 2>&1", shell=True)
|
||||||
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)
|
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
|
@ -10,7 +10,7 @@ try:
|
||||||
#stop pypo and liquidsoap processes
|
#stop pypo and liquidsoap processes
|
||||||
print "Waiting for pypo processes to stop...",
|
print "Waiting for pypo processes to stop...",
|
||||||
if (os.path.exists('/etc/init.d/airtime-playout')):
|
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]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
print "OK"
|
print "OK"
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -30,7 +30,7 @@ try:
|
||||||
print 'Error loading config file: ', e
|
print 'Error loading config file: ', e
|
||||||
sys.exit(1)
|
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("rm -f /etc/init.d/airtime-playout")
|
||||||
os.system("update-rc.d -f airtime-playout remove >/dev/null 2>&1")
|
os.system("update-rc.d -f airtime-playout remove >/dev/null 2>&1")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue