diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-10-18 10:17:42 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-10-18 10:18:05 -0400 |
commit | 721c3638d6a60531f152cd48d255b8c1ae0044cf (patch) | |
tree | 941aed630fc8ef23f53a99e22816d32731db6d2a | |
parent | 797bef4955f03224681683836e3147bab4e90a8e (diff) | |
download | bcfg2-721c3638d6a60531f152cd48d255b8c1ae0044cf.tar.gz bcfg2-721c3638d6a60531f152cd48d255b8c1ae0044cf.tar.bz2 bcfg2-721c3638d6a60531f152cd48d255b8c1ae0044cf.zip |
fixed server core instantiation when running in foreground
-rw-r--r-- | src/lib/Bcfg2/Server/BuiltinCore.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/Bcfg2/Server/BuiltinCore.py b/src/lib/Bcfg2/Server/BuiltinCore.py index 8eb8806bc..e7931b844 100644 --- a/src/lib/Bcfg2/Server/BuiltinCore.py +++ b/src/lib/Bcfg2/Server/BuiltinCore.py @@ -29,13 +29,17 @@ class Core(BaseCore): #: this server core self.server = None - #: The :class:`daemon.DaemonContext` used to drop privileges, - #: write the PID file (with :class:`PidFile`), and daemonize - #: this core. - self.context = \ - daemon.DaemonContext(uid=self.setup['daemon_uid'], - gid=self.setup['daemon_gid'], - pidfile=PIDLockFile(self.setup['daemon'])) + if self.setup['daemon']: + #: The :class:`daemon.DaemonContext` used to drop + #: privileges, write the PID file (with :class:`PidFile`), + #: and daemonize this core. + self.context = \ + daemon.DaemonContext(uid=self.setup['daemon_uid'], + gid=self.setup['daemon_gid'], + pidfile=PIDLockFile(self.setup['daemon'])) + else: + self.context = daemon.DaemonContext(uid=self.setup['daemon_uid'], + gid=self.setup['daemon_gid']) __init__.__doc__ = BaseCore.__init__.__doc__.split('.. -----')[0] def _dispatch(self, method, args, dispatch_dict): |