-show which process id is being shutdown when calling airtime-xxx-stop

This commit is contained in:
martin 2011-05-17 11:55:16 -04:00
parent 91caaf2c0f
commit 35e617911b
3 changed files with 7 additions and 3 deletions

View File

@ -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."

View File

@ -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."

View File

@ -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."