From 1d9fa990582c214f3f40d1a10e97accfc38e3468 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 11 Aug 2021 23:37:57 +0000 Subject: [PATCH] fixed delay in daemon stopping --- src/cli/superscript-socket.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cli/superscript-socket.py b/src/cli/superscript-socket.py index 7a56d98..14a96a3 100644 --- a/src/cli/superscript-socket.py +++ b/src/cli/superscript-socket.py @@ -291,11 +291,13 @@ def stop(pid_path): except IOError: sys.stderr.write("pidfile at <" + pid_path + "> does not exist. Daemon not running?\n") return - + try: - os.kill(pid, SIGTERM) - return + while True: + os.kill(pid, SIGTERM) + time.sleep(0.01) except OSError as err: + err = str(err) if err.find("No such process") > 0: if os.path.exists(pid_path): os.remove(pid_path)