From 313181f48f0862925184f5fd7e1fb7ecfacb521a Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 16 Jun 2018 22:32:16 -0400 Subject: [PATCH] Add proper exit --- pvcd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvcd.py b/pvcd.py index 95a22922..14a63fbc 100755 --- a/pvcd.py +++ b/pvcd.py @@ -116,10 +116,11 @@ zk.add_listener(zk_listener) @atexit.register def cleanup(): + update_timer.shutdown() zk.set('/nodes/{}/daemonstate'.format(myhostname), 'stop'.encode('ascii')) zk.stop() zk.close() - update_timer.shutdown() + exit(0) # Handle SIGTERM gracefully signal.signal(signal.SIGTERM, cleanup)