From 4304d0a7e232ebf52572eba8773d0dd9921bbb4f Mon Sep 17 00:00:00 2001 From: alexhudson Date: Wed, 7 Jul 2010 18:18:26 +0000 Subject: [PATCH] Make bongo-manager try harder to contact the store on startup, but exit if it really gives up. --- src/apps/manager/manager.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/apps/manager/manager.c b/src/apps/manager/manager.c index adb0242..ba5f906 100644 --- a/src/apps/manager/manager.c +++ b/src/apps/manager/manager.c @@ -309,7 +309,13 @@ LoadAgentConfiguration() GArray *agentlist; unsigned int i; - if (! NMAPReadConfigFile("manager", &config) || (config == NULL)) { + for(i = 0; i < 8; i++) { + // give the Store seven seconds to startup + // Eventually this should be event-driven. + if (NMAPReadConfigFile("manager", &config)) break; + XplDelay(1000); + } + if (config == NULL) { printf(_("bongo-manager: couldn't read config from store\n")); return FALSE; } @@ -890,9 +896,9 @@ get_lock: if (!slapdOnly) { SetupAgentList(); StartStore(); - XplDelay(1000); // hack: small delay to let store start up if (!LoadAgentConfiguration()) { printf(_("bongo-manager: Couldn't load configuration for agents\n")); + exit(-1); // no point continuing... } StartAgents(FALSE, FALSE); }