From 35e617911bbcb612d43191c5957cd39bc6b1c770 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 17 May 2011 11:55:16 -0400 Subject: [PATCH] -show which process id is being shutdown when calling airtime-xxx-stop --- python_apps/pypo/airtime-pypo-stop | 6 ++++-- python_apps/pytag-fs/airtime-media-monitor-stop | 1 + python_apps/show-recorder/airtime-show-recorder-stop | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/python_apps/pypo/airtime-pypo-stop b/python_apps/pypo/airtime-pypo-stop index 08dcbef00..009be17fc 100755 --- a/python_apps/pypo/airtime-pypo-stop +++ b/python_apps/pypo/airtime-pypo-stop @@ -10,18 +10,19 @@ if os.geteuid() != 0: sys.exit(1) try: - print "Stopping daemontool script pypo...", + print "Stopping daemontool script pypo..." p1 = subprocess.Popen(["ps", "aux"], stdout=subprocess.PIPE) p2 = subprocess.Popen(["awk", "/pypo-cli.py/ && !/awk/ {print $2}"], stdin=p1.stdout, stdout=subprocess.PIPE) pypo_pid = p2.communicate()[0].strip(" \n\r\t") if (len(pypo_pid) > 0): os.system("svc -d /etc/service/pypo 1>/dev/null 2>&1") os.system("svc -d /etc/service/pypo/log 1>/dev/null 2>&1") + print "Shutting down process id %s" % pypo_pid print "Success." else: print "Not Running." - print "Stopping daemontool script pypo-liquidsoap...", + print "Stopping daemontool script pypo-liquidsoap..." p1 = subprocess.Popen(["ps", "aux"], stdout=subprocess.PIPE) p2 = subprocess.Popen(["awk", "/ls_script.liq/ && !/awk/ {print $2}"], stdin=p1.stdout, stdout=subprocess.PIPE) liquidsoap_pid = p2.communicate()[0].strip(" \n\r\t") @@ -32,6 +33,7 @@ try: pids = liquidsoap_pid.split("\n") for pid in pids: os.system("kill -2 %s" % pid) + print "Shutting down process id %s" % liquidsoap_pid print "Success." else: print "Not Running." diff --git a/python_apps/pytag-fs/airtime-media-monitor-stop b/python_apps/pytag-fs/airtime-media-monitor-stop index b51b1ba6a..735464dd8 100755 --- a/python_apps/pytag-fs/airtime-media-monitor-stop +++ b/python_apps/pytag-fs/airtime-media-monitor-stop @@ -19,6 +19,7 @@ try: 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) + print "Shutting down process id %s" % recorder_pid print "Success." else: print "Not Running." diff --git a/python_apps/show-recorder/airtime-show-recorder-stop b/python_apps/show-recorder/airtime-show-recorder-stop index 43cdac7b5..e9a529bfd 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) @@ -22,6 +22,7 @@ try: pids = recorder_pid.split("\n") for pid in pids: os.system("kill -2 %s" % pid) + print "Shutting down process id %s" % pid print "Success." else: print "Not Running."