etwist/server.py
changeset 6782 b5d6f5391695
parent 6779 accf5978a440
child 6817 1959d97ebf2e
--- a/etwist/server.py	Tue Jan 04 14:11:54 2011 +0100
+++ b/etwist/server.py	Wed Jan 05 17:50:21 2011 +0100
@@ -415,8 +415,9 @@
                                      "commands (e.g : 'net start my_instance)'")
         from logilab.common.daemon import daemonize
         LOGGER.info('instance started in the background on %s', root_resource.base_url)
-        if daemonize(config['pid-file']):
-            return # child process
+        whichproc = daemonize(config['pid-file'], umask=config['umask'])
+        if whichproc: # 1 = orig process, 2 = first fork, None = second fork (eg daemon process)
+            return whichproc # parent process
     root_resource.init_publisher() # before changing uid
     if config['uid'] is not None:
         try: