mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 23:18:40 +00:00
fix start/stop
This commit is contained in:
parent
b6dd803a95
commit
87fe5fe4ad
1 changed files with 7 additions and 11 deletions
|
@ -79,11 +79,11 @@ class plugin_WebUi(object):
|
||||||
self.proc = None
|
self.proc = None
|
||||||
self.web_server = None
|
self.web_server = None
|
||||||
if not deluge.common.windows_check():
|
if not deluge.common.windows_check():
|
||||||
if os.WEXITSTATUS(os.system('ps x -o pid,args |grep -v grep |grep -q run_webserver')):
|
import commands
|
||||||
import commands
|
pid = commands.getstatus('ps x |grep -v grep |grep run_webserver |awk {\'print $1\'}')
|
||||||
pid = commands.getoutput('ps x -o pid,args |grep -v grep |grep run_webserver |awk {\'print $1\'}')
|
if pid == 0:
|
||||||
os.kill(pid, 9)
|
os.kill(pid[1], 9)
|
||||||
time.sleep(1) #safe time to wait for kill to finish.
|
time.sleep(1) #safe time to wait for kill to finish.
|
||||||
self.config_file = deluge.common.CONFIG_DIR + "/webui.conf"
|
self.config_file = deluge.common.CONFIG_DIR + "/webui.conf"
|
||||||
self.config = deluge.pref.Preferences(self.config_file, False)
|
self.config = deluge.pref.Preferences(self.config_file, False)
|
||||||
try:
|
try:
|
||||||
|
@ -162,12 +162,8 @@ class plugin_WebUi(object):
|
||||||
self.web_server.stop_gtk()
|
self.web_server.stop_gtk()
|
||||||
self.web_server = None
|
self.web_server = None
|
||||||
if self.proc:
|
if self.proc:
|
||||||
if os.WEXITSTATUS(os.system('ps x -o pid,args |grep -v grep |grep -q run_webserver')):
|
print "webserver: kill %i" % self.proc.pid
|
||||||
import commands
|
os.system("kill -9 %i" % self.proc.pid)
|
||||||
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.
|
time.sleep(1) #safe time to wait for kill to finish.
|
||||||
self.proc = None
|
self.proc = None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue