Skip to content
Snippets Groups Projects
Commit f1115454 authored by Guido Trotter's avatar Guido Trotter
Browse files

Abstract starting the node daemons


We're using a separate function for this, as we're going to add some
functionality to this feature.

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 46cf6260
No related branches found
No related tags found
No related merge requests found
...@@ -84,6 +84,16 @@ def EnsureDaemon(name): ...@@ -84,6 +84,16 @@ def EnsureDaemon(name):
return True return True
def StartNodeDaemons():
"""Start all the daemons that should be running on all nodes.
"""
# on master or not, try to start the node dameon
EnsureDaemon(constants.NODED)
# start confd as well. On non candidates it will be in disabled mode.
EnsureDaemon(constants.CONFD)
class WatcherState(object): class WatcherState(object):
"""Interface to a state file recording restart attempts. """Interface to a state file recording restart attempts.
...@@ -477,10 +487,7 @@ def main(): ...@@ -477,10 +487,7 @@ def main():
update_file = False update_file = False
try: try:
# on master or not, try to start the node dameon StartNodeDaemons()
EnsureDaemon(constants.NODED)
# start confd as well. On non candidates it will be in disabled mode.
EnsureDaemon(constants.CONFD)
notepad = WatcherState() notepad = WatcherState()
try: try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment