From 52c019ad8fecd3026f46164812e21f1f4a350ecc Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 16 May 2011 21:33:51 +0200 Subject: account login timeout, better shutdown --- pyLoadCore.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'pyLoadCore.py') 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" -- cgit v1.2.3