etwist/server.py
branchstable
changeset 6778 7dd4835d5198
parent 5940 0e3ae19b181a
child 6779 accf5978a440
--- a/etwist/server.py	Thu Dec 23 15:49:29 2010 +0100
+++ b/etwist/server.py	Wed Jan 05 15:32:37 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'])
+        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: