summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/CherrypyCore.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-06-12 01:20:16 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2015-06-12 03:39:34 +0200
commit33e53dde2a85b8783c8e4935868d9c5f50dea440 (patch)
treedb7ffd6e4fc403a2d0b361481423003ee674802f /src/lib/Bcfg2/Server/CherrypyCore.py
parentf6b4bd47fc071f0a5230cbb6f59cbffc6b2b624b (diff)
parentee11ee47bf86b67db100d76932a912d8239fa9d9 (diff)
downloadbcfg2-33e53dde2a85b8783c8e4935868d9c5f50dea440.tar.gz
bcfg2-33e53dde2a85b8783c8e4935868d9c5f50dea440.tar.bz2
bcfg2-33e53dde2a85b8783c8e4935868d9c5f50dea440.zip
Merge branch 'maint'
Conflicts: debian/changelog doc/conf.py misc/bcfg2-selinux.spec misc/bcfg2.spec osx/Makefile osx/macports/Portfile solaris-ips/MANIFEST.bcfg2-server.header solaris-ips/MANIFEST.bcfg2.header solaris-ips/Makefile solaris-ips/pkginfo.bcfg2 solaris-ips/pkginfo.bcfg2-server solaris/Makefile solaris/pkginfo.bcfg2 solaris/pkginfo.bcfg2-server src/lib/Bcfg2/Client/Tools/APT.py src/lib/Bcfg2/Client/Tools/FreeBSDInit.py src/lib/Bcfg2/Client/Tools/__init__.py src/lib/Bcfg2/Options.py src/lib/Bcfg2/Reporting/Collector.py src/lib/Bcfg2/Reporting/templates/base.html src/lib/Bcfg2/Server/CherrypyCore.py src/lib/Bcfg2/Server/Core.py src/lib/Bcfg2/Server/FileMonitor/__init__.py src/lib/Bcfg2/Server/Lint/Validate.py src/lib/Bcfg2/Server/Lint/__init__.py src/lib/Bcfg2/Server/MultiprocessingCore.py src/lib/Bcfg2/Server/Plugin/__init__.py src/lib/Bcfg2/Server/Plugins/GroupPatterns.py src/lib/Bcfg2/Server/Plugins/Metadata.py src/lib/Bcfg2/Server/Plugins/Packages/Source.py src/lib/Bcfg2/Server/Plugins/Packages/Yum.py src/lib/Bcfg2/Server/Plugins/SSHbase.py src/lib/Bcfg2/Server/Plugins/SSLCA.py src/lib/Bcfg2/version.py src/sbin/bcfg2-info src/sbin/bcfg2-test testsuite/requirements.txt
Diffstat (limited to 'src/lib/Bcfg2/Server/CherrypyCore.py')
-rw-r--r--src/lib/Bcfg2/Server/CherrypyCore.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Server/CherrypyCore.py b/src/lib/Bcfg2/Server/CherrypyCore.py
index 3cb0e291b..05c6c5a94 100644
--- a/src/lib/Bcfg2/Server/CherrypyCore.py
+++ b/src/lib/Bcfg2/Server/CherrypyCore.py
@@ -110,17 +110,21 @@ class CherrypyCore(NetworkCore):
return cherrypy.serving.response.body
def _daemonize(self):
- """ Drop privileges with
- :class:`cherrypy.process.plugins.DropPrivileges`, daemonize
- with :class:`cherrypy.process.plugins.Daemonizer`, and write a
+ """ Drop privileges, daemonize
+ with :class:`cherrypy.process.plugins.Daemonizer` and write a
PID file with :class:`cherrypy.process.plugins.PIDFile`. """
+ self._drop_privileges()
+ Daemonizer(cherrypy.engine).subscribe()
+ PIDFile(cherrypy.engine, Bcfg2.Options.setup.daemon).subscribe()
+ return True
+
+ def _drop_privileges(self):
+ """ Drop privileges with
+ :class:`cherrypy.process.plugins.DropPrivileges` """
DropPrivileges(cherrypy.engine,
uid=Bcfg2.Options.setup.daemon_uid,
gid=Bcfg2.Options.setup.daemon_gid,
umask=int(Bcfg2.Options.setup.umask, 8)).subscribe()
- Daemonizer(cherrypy.engine).subscribe()
- PIDFile(cherrypy.engine, Bcfg2.Options.setup.daemon).subscribe()
- return True
def _run(self):
""" Start the server listening. """