From 0060c0313b5aa863a9756ef60229b9b5cc825ba9 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 19 Jun 2019 14:23:07 -0400 Subject: [PATCH] Put daemonstate to shutdown when stopping This way it isn't "run" all the way until it shuts down. --- node-daemon/pvcd/Daemon.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node-daemon/pvcd/Daemon.py b/node-daemon/pvcd/Daemon.py index 2162be19..c761fe56 100644 --- a/node-daemon/pvcd/Daemon.py +++ b/node-daemon/pvcd/Daemon.py @@ -472,6 +472,9 @@ zk_conn.add_listener(zk_listener) def cleanup(): global zk_conn, update_timer, d_domains + # Set stop state in Zookeeper + zkhandler.writedata(zk_conn, { '/nodes/{}/daemonstate'.format(myhostname): 'shutdown' }) + logger.out('Performing final keepalive update', state='s') update_zookeeper()