From b9c1f7356fccf427283d44614830186ac0ac4165 Mon Sep 17 00:00:00 2001 From: mkonecny Date: Thu, 5 May 2011 23:18:24 -0400 Subject: [PATCH] CC-2250: airtime-pypo-stop doesnt work -fixed --- python_apps/pypo/airtime-pypo-stop | 5 ++++- python_apps/pypo/install/pypo-daemontools-liquidsoap.sh | 4 +++- python_apps/show-recorder/airtime-show-recorder-stop | 7 +++++-- python_apps/show-recorder/install/recorder-daemontools.sh | 4 +++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/python_apps/pypo/airtime-pypo-stop b/python_apps/pypo/airtime-pypo-stop index 4a2107279..08dcbef00 100755 --- a/python_apps/pypo/airtime-pypo-stop +++ b/python_apps/pypo/airtime-pypo-stop @@ -28,7 +28,10 @@ try: if (len(liquidsoap_pid) > 0): os.system("svc -d /etc/service/pypo-liquidsoap 1>/dev/null 2>&1") os.system("svc -d /etc/service/pypo-liquidsoap/log 1>/dev/null 2>&1") - os.system("kill -2 %s" % liquidsoap_pid) + + pids = liquidsoap_pid.split("\n") + for pid in pids: + os.system("kill -2 %s" % pid) print "Success." else: print "Not Running." diff --git a/python_apps/pypo/install/pypo-daemontools-liquidsoap.sh b/python_apps/pypo/install/pypo-daemontools-liquidsoap.sh index 4005cfd48..6c4ebe65a 100755 --- a/python_apps/pypo/install/pypo-daemontools-liquidsoap.sh +++ b/python_apps/pypo/install/pypo-daemontools-liquidsoap.sh @@ -10,6 +10,8 @@ exec 2>&1 cd /usr/lib/airtime/pypo/bin/scripts export PYTHONPATH=${api_client_path} -su ${ls_user} -c "${ls_path} ${ls_param}" +#su ${ls_user} -c "${ls_path} ${ls_param}" 2>&1 + +setuidgid ${ls_user} ${ls_path} ${ls_param} # EOF diff --git a/python_apps/show-recorder/airtime-show-recorder-stop b/python_apps/show-recorder/airtime-show-recorder-stop index b51b1ba6a..43cdac7b5 100755 --- a/python_apps/show-recorder/airtime-show-recorder-stop +++ b/python_apps/show-recorder/airtime-show-recorder-stop @@ -10,7 +10,7 @@ if os.geteuid() != 0: sys.exit(1) try: - print "Stopping daemontool script recorder" + print "Stopping daemontool script recorder...", p1 = subprocess.Popen(["ps", "aux"], stdout=subprocess.PIPE) p2 = subprocess.Popen(["awk", "/recorder.py/ && !/awk/ {print $2}"], stdin=p1.stdout, stdout=subprocess.PIPE) @@ -18,7 +18,10 @@ try: if (len(recorder_pid) > 0): os.system("svc -d /etc/service/recorder 1>/dev/null 2>&1") os.system("svc -d /etc/service/recorder/log 1>/dev/null 2>&1") - os.system("kill -2 %s" % recorder_pid) + + pids = recorder_pid.split("\n") + for pid in pids: + os.system("kill -2 %s" % pid) print "Success." else: print "Not Running." diff --git a/python_apps/show-recorder/install/recorder-daemontools.sh b/python_apps/show-recorder/install/recorder-daemontools.sh index 2500a7679..4190d1112 100755 --- a/python_apps/show-recorder/install/recorder-daemontools.sh +++ b/python_apps/show-recorder/install/recorder-daemontools.sh @@ -15,7 +15,9 @@ exec 2>&1 # Note the -u when calling python! we need it to get unbuffered binary stdout and stderr export PYTHONPATH=${api_client_path} -su ${recorder_user} -c "python -u ${recorder_path}${recorder_script}" +#su ${recorder_user} -c "python -u ${recorder_path}${recorder_script}" + +setuidgid ${recorder_user} ${recorder_path}${recorder_script} # EOF