diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-03-09 18:18:59 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-03-09 18:18:59 +0000 |
commit | f827612576845b27548a3b7a1b14de01a27039d4 (patch) | |
tree | dcf08b7d422918e6f760f4bd45db997c8350289a | |
parent | e271e17a4a12984381ff15a219d7ebd832c77200 (diff) | |
download | bcfg2-f827612576845b27548a3b7a1b14de01a27039d4.tar.gz bcfg2-f827612576845b27548a3b7a1b14de01a27039d4.tar.bz2 bcfg2-f827612576845b27548a3b7a1b14de01a27039d4.zip |
improve startup even handling for bcfg2-info and bcfg2-server
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5115 ce84e21b-d406-0410-9b95-82705330c041
-rwxr-xr-x | src/sbin/bcfg2-info | 5 | ||||
-rwxr-xr-x | src/sbin/bcfg2-server | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index 4f7228c8e..594327016 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -2,7 +2,7 @@ '''This tool loads the Bcfg2 core into an interactive debugger''' __revision__ = '$Revision$' -import copy, logging, lxml.etree, sys, cmd +import copy, logging, lxml.etree, sys, cmd, time import Bcfg2.Logger, Bcfg2.Server.Core, os import Bcfg2.Server.Plugins.Metadata, Bcfg2.Server.Plugin import Bcfg2.Options @@ -38,8 +38,9 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core): self.prompt = '> ' self.cont = True i = 0 - while self.fam.Service() or i < 5: + while self.fam.Service() or i < 10: i += 1 + time.sleep(0.1) def do_loop(self): self.cont = True diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index 791f6a1bd..c80655528 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -9,7 +9,7 @@ from Bcfg2.Server.Core import Core, CoreInitError from xmlrpclib import Fault from lxml.etree import XML, Element, tostring -import logging, select, socket, sys +import logging, select, socket, sys, time import Bcfg2.Logger, Bcfg2.Options, Bcfg2.Component, Bcfg2.Daemon logger = logging.getLogger('bcfg2-server') @@ -55,7 +55,10 @@ class Bcfg2Serv(Bcfg2.Component.Component): logger.error("Hit event timeout without getting any events; GAMIN/FAM problem?") continue events = True - self.Core.Service() + i = 0 + while self.Core.fam.Service() or i < 10: + i += 1 + time.sleep(0.1) except socket.error: continue try: |