-remove "disable_auto_start_services" install option
This commit is contained in:
parent
68c908eeac
commit
b00e74e831
|
@ -26,8 +26,7 @@ showhelp () {
|
|||
--pypo|-p Install only pypo and liquidsoap
|
||||
--show-recorder|-s Install only show-recorder
|
||||
--web|-w Install only files for web-server
|
||||
--liquidsoap-keep-alive|-l Keep Liquidsoap alive when upgrading
|
||||
--disable-auto-start-services|-d Disable auto-starting Airtime services"
|
||||
--liquidsoap-keep-alive|-l Keep Liquidsoap alive when upgrading"
|
||||
}
|
||||
|
||||
overwrite="f"
|
||||
|
@ -39,9 +38,8 @@ pypo="f"
|
|||
showrecorder="f"
|
||||
web="f"
|
||||
liquidsoap_keep_alive="f"
|
||||
disable_auto_start_services="f"
|
||||
|
||||
set -- $(getopt -l help,overwrite,preserve,no-db,reinstall,media-monitor,pypo,show-recorder,web,liquidsoap-keep-alive,disable-auto-start-services "hopnrmyswld" "$@")
|
||||
set -- $(getopt -l help,overwrite,preserve,no-db,reinstall,media-monitor,pypo,show-recorder,web,liquidsoap-keep-alive "hopnrmyswl" "$@")
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
|
@ -55,7 +53,6 @@ do
|
|||
(-s|--show-recorder) showrecorder="t";;
|
||||
(-w|--web) web="t";;
|
||||
(-l|--liquidsoap-keep-alive) liquidsoap_keep_alive="t";;
|
||||
(-d|--disable-auto-start-services) disable_auto_start_services="t";;
|
||||
|
||||
(--) shift; break;;
|
||||
(-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;
|
||||
|
@ -147,7 +144,6 @@ export nodb
|
|||
export overwrite
|
||||
export preserve
|
||||
export liquidsoap_keep_alive
|
||||
export disable_auto_start_services
|
||||
|
||||
set +e
|
||||
test "$mediamonitor" = "t" -o "$pypo" = "t" -o "$showrecorder" = "t"
|
||||
|
|
|
@ -53,17 +53,12 @@ sleep 1
|
|||
|
||||
set +e
|
||||
|
||||
if [ "$disable_auto_start_services" = "f" ]; then
|
||||
if [ "$mediamonitor" = "t" ]; then
|
||||
monit monitor airtime-media-monitor
|
||||
fi
|
||||
if [ "$pypo" = "t" ]; then
|
||||
monit monitor airtime-playout
|
||||
monit monitor airtime-liquidsoap
|
||||
fi
|
||||
# if [ "$showrecorder" = "t" ]; then
|
||||
# monit monitor airtime-show-recorder
|
||||
# fi
|
||||
if [ "$mediamonitor" = "t" ]; then
|
||||
monit monitor airtime-media-monitor
|
||||
fi
|
||||
if [ "$pypo" = "t" ]; then
|
||||
monit monitor airtime-playout
|
||||
monit monitor airtime-liquidsoap
|
||||
fi
|
||||
|
||||
monit monitor rabbitmq-server
|
||||
|
|
|
@ -50,8 +50,8 @@ try:
|
|||
#copy monit files
|
||||
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
subprocess.call('sed -i "s/\$admin_pass/%s/g" /etc/monit/conf.d/monit-airtime-generic.cfg' % get_rand_string(), shell=True)
|
||||
if os.environ["disable_auto_start_services"] == "f":
|
||||
shutil.copy('%s/../monit-airtime-media-monitor.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
|
||||
shutil.copy('%s/../monit-airtime-media-monitor.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
|
||||
#create log dir
|
||||
create_dir(config['log_dir'])
|
||||
|
|
|
@ -9,18 +9,18 @@ try:
|
|||
#create media-monitor dir under /var/tmp/airtime
|
||||
if not os.path.exists("/var/tmp/airtime/media-monitor"):
|
||||
os.makedirs("/var/tmp/airtime/media-monitor")
|
||||
if os.environ["disable_auto_start_services"] == "f":
|
||||
#update-rc.d init script
|
||||
p = Popen("update-rc.d airtime-media-monitor defaults >/dev/null 2>&1", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
#Start media-monitor daemon
|
||||
print "* Waiting for media-monitor processes to start..."
|
||||
"""
|
||||
p = Popen("/etc/init.d/airtime-media-monitor stop", 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]
|
||||
#update-rc.d init script
|
||||
p = Popen("update-rc.d airtime-media-monitor defaults >/dev/null 2>&1", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
#Start media-monitor daemon
|
||||
print "* Waiting for media-monitor processes to start..."
|
||||
"""
|
||||
p = Popen("/etc/init.d/airtime-media-monitor stop", 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]
|
||||
except Exception, e:
|
||||
print e
|
||||
|
|
|
@ -51,9 +51,9 @@ try:
|
|||
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
subprocess.call('sed -i "s/\$admin_pass/%s/g" /etc/monit/conf.d/monit-airtime-generic.cfg' % get_rand_string(), shell=True)
|
||||
shutil.copy('%s/../../monit/monit-airtime-rabbitmq-server.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
if os.environ["disable_auto_start_services"] == "f":
|
||||
shutil.copy('%s/../monit-airtime-liquidsoap.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
shutil.copy('%s/../monit-airtime-playout.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
|
||||
shutil.copy('%s/../monit-airtime-liquidsoap.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
shutil.copy('%s/../monit-airtime-playout.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
|
||||
#create pypo log dir
|
||||
create_dir(config['pypo_log_dir'])
|
||||
|
|
|
@ -111,25 +111,24 @@ try:
|
|||
else:
|
||||
print "Unable to connect to the Airtime server."
|
||||
|
||||
if os.environ["disable_auto_start_services"] == "f":
|
||||
#initialize init.d scripts
|
||||
p = Popen("update-rc.d airtime-playout defaults >/dev/null 2>&1", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
#initialize init.d scripts
|
||||
p = Popen("update-rc.d airtime-playout defaults >/dev/null 2>&1", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
#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)
|
||||
#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)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
except Exception, e:
|
||||
print e
|
||||
|
|
Loading…
Reference in New Issue