summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Pinto <markybob@dipconsultants.com>2007-10-14 23:26:55 +0000
committerMarcos Pinto <markybob@dipconsultants.com>2007-10-14 23:26:55 +0000
commitb6dd803a9543645590ee8726b2fdba2ba333bac5 (patch)
tree91752c7e97ca4b2c15e23084dac80b37dec29e2f
parent30b5967f12871e28ce2ac42ccd588181a44ae643 (diff)
downloaddeluge-b6dd803a9543645590ee8726b2fdba2ba333bac5.tar.gz
deluge-b6dd803a9543645590ee8726b2fdba2ba333bac5.tar.bz2
deluge-b6dd803a9543645590ee8726b2fdba2ba333bac5.zip
really kill
-rw-r--r--plugins/WebUi/__init__.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/WebUi/__init__.py b/plugins/WebUi/__init__.py
index 559e380a2..38f284092 100644
--- a/plugins/WebUi/__init__.py
+++ b/plugins/WebUi/__init__.py
@@ -80,7 +80,10 @@ class plugin_WebUi(object):
self.web_server = None
if not deluge.common.windows_check():
if os.WEXITSTATUS(os.system('ps x -o pid,args |grep -v grep |grep -q run_webserver')):
- os.system('killall run_webserver')
+ import commands
+ pid = commands.getoutput('ps x -o pid,args |grep -v grep |grep run_webserver |awk {\'print $1\'}')
+ os.kill(pid, 9)
+ time.sleep(1) #safe time to wait for kill to finish.
self.config_file = deluge.common.CONFIG_DIR + "/webui.conf"
self.config = deluge.pref.Preferences(self.config_file, False)
try:
@@ -159,8 +162,12 @@ class plugin_WebUi(object):
self.web_server.stop_gtk()
self.web_server = None
if self.proc:
- print "webserver: kill %i" % self.proc.pid
- os.system("kill %i" % self.proc.pid)
+ if os.WEXITSTATUS(os.system('ps x -o pid,args |grep -v grep |grep -q run_webserver')):
+ import commands
+ pid = commands.getoutput('ps x -o pid,args |grep -v grep |grep run_webserver |awk {\'print $1\'}')
+ os.kill(pid, 9)
+# print "webserver: kill %i" % self.proc.pid
+ # os.system("kill %i" % self.proc.pid)
time.sleep(1) #safe time to wait for kill to finish.
self.proc = None