summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sbin/Bcfg2Server13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/sbin/Bcfg2Server b/src/sbin/Bcfg2Server
index 0755eb882..6d2329789 100644
--- a/src/sbin/Bcfg2Server
+++ b/src/sbin/Bcfg2Server
@@ -4,7 +4,7 @@
from socket import gethostbyaddr, herror
from string import split
from syslog import syslog, LOG_INFO, LOG_ERR
-from sys import exc_info
+from sys import exit, exc_info
from time import time
from traceback import extract_tb
from ConfigParser import ConfigParser
@@ -14,6 +14,7 @@ from elementtree.ElementTree import Element, tostring
from Bcfg2.Server.Core import Core
from Bcfg2.Server.Metadata import MetadataStore
+from sss.daemonize import daemonize
from sss.restriction import DataSet, Data
from sss.server import Server
@@ -30,11 +31,7 @@ class BcfgServer(Server):
generators = split(c.get('server','generators'),',')
structures = split(c.get('server', 'structures'),',')
mpath = c.get('server','metadata')
- try:
- self.core = Core(repo, structures, generators)
- except IOError, e:
- syslog(LOG_ERR, "Failed to connect to FAM")
- self.shut = 1
+ self.core = Core(repo, structures, generators)
self.metadata = MetadataStore("%s/metadata.xml"%(mpath), self.core.fam)
self.__progress__()
@@ -113,7 +110,9 @@ class BcfgServer(Server):
del t,v,tb
if __name__ == '__main__':
+ if '--daemon' in argv:
+ daemonize('/dev/null')
server = BcfgServer()
for i in range(10):
server.__progress__()
- Server.ServeForever()
+ server.ServeForever()