commit 89fd0ae28a7789813ad315e8e9f4546b49461717
Author: Arturo Filastò <art(a)fuffa.org>
Date: Thu Jun 6 20:04:48 2013 +0200
Respect the nodaemon and chroot config options
---
bin/oonib | 9 +++++++--
oonib/oonibackend.py | 6 +++---
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/bin/oonib b/bin/oonib
index cda5bc0..b82373d 100755
--- a/bin/oonib
+++ b/bin/oonib
@@ -13,8 +13,13 @@ sys.path.insert(0, os.path.abspath(os.getcwd()))
from oonib import runner, config
from oonib.oonibackend import application
-# Uncomment this line to daemonize
-#sys.argv[1:] = ['-y', backend_script]
+if config.main.chroot:
+ sys.argv.append('--chroot')
+ sys.argv.append(config.chroot)
+
+if not config.main.nodaemon:
+ sys.argv.append('-y')
+ sys.argv.append(backend_script)
def runApp(config):
runner.OBaseRunner(config).run()
diff --git a/oonib/oonibackend.py b/oonib/oonibackend.py
index 9e3e9cb..0eef588 100644
--- a/oonib/oonibackend.py
+++ b/oonib/oonibackend.py
@@ -23,9 +23,9 @@ from oonib import log
from oonib import db_threadpool
from oonib import config
-if config.uid and config.gid:
- application = service.Application('oonibackend', uid=config.uid,
- gid=config.gid)
+if config.main.uid and config.main.gid:
+ application = service.Application('oonibackend', uid=config.main.uid,
+ gid=config.main.gid)
else:
application = service.Application('oonibackend')