diff options
author | 2011-05-16 21:33:51 +0200 | |
---|---|---|
committer | 2011-05-16 21:33:51 +0200 | |
commit | 52c019ad8fecd3026f46164812e21f1f4a350ecc (patch) | |
tree | 6d1ca9b60daa63f30c1a972497bf970206d68c0a /pyLoadCore.py | |
parent | fix #165, #277 (diff) | |
download | pyload-52c019ad8fecd3026f46164812e21f1f4a350ecc.tar.xz |
account login timeout, better shutdown
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-x | pyLoadCore.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py index 0cdd9efcb..09b039a4e 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -211,7 +211,20 @@ class Core(object): try: os.kill(pid, 3) #SIGUIT - print "pyLoad successfully stopped" + + t = time() + print "waiting for pyLoad to quit" + + while exists(self.pidfile) and t + 10 > time(): + sleep(0.25) + + if not exists(self.pidfile): + print "pyLoad successfully stopped" + else: + os.kill(pid, 9) #SIGKILL + print "pyLoad did not respond" + print "Kill signal was send to process with id %s" % pid + except: print "Error quitting pyLoad" |