From 2b4c3619d6fd29cf80c203454eaee659b8c301ea Mon Sep 17 00:00:00 2001 From: clowwindy Date: Sun, 21 Dec 2014 14:52:00 +0800 Subject: [PATCH] reorder setsid and kill --- shadowsocks/daemon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shadowsocks/daemon.py b/shadowsocks/daemon.py index 9e252e0..ec6676c 100644 --- a/shadowsocks/daemon.py +++ b/shadowsocks/daemon.py @@ -123,12 +123,12 @@ def daemon_start(pid_file, log_file): os.kill(ppid, signal.SIGINT) sys.exit(1) - print('started') - os.kill(ppid, signal.SIGTERM) - os.setsid() signal.signal(signal.SIG_IGN, signal.SIGHUP) + print('started') + os.kill(ppid, signal.SIGTERM) + sys.stdin.close() try: freopen(log_file, 'a', sys.stdout)