etwist/server.py
changeset 3589 a5432f99f2d9
parent 3503 06bced8edddf
parent 3558 0e478957a9d4
child 3629 559cad62c786
--- a/etwist/server.py	Wed Sep 30 18:57:42 2009 +0200
+++ b/etwist/server.py	Wed Oct 07 12:31:08 2009 +0200
@@ -35,7 +35,7 @@
     # (start-repository command)
     # See http://www.erlenstar.demon.co.uk/unix/faq_toc.html#TOC16
     if os.fork():   # launch child and...
-        return -1
+        os._exit(0)
     os.setsid()
     if os.fork():   # launch child and...
         os._exit(0) # kill off parent again.
@@ -379,12 +379,11 @@
     logger = getLogger('cubicweb.twisted')
     logger.info('instance started on %s', baseurl)
     if not debug:
-        if daemonize():
-            # child process
-            return
+        print 'instance starting in the background'
+        daemonize()
         if config['pid-file']:
             # ensure the directory where the pid-file should be set exists (for
-            # instance /var/run/cubicweb may be deleted on computer restart)
+            # instance /var/run/cubicweb may be deleted on computer restart) 
             piddir = os.path.dirname(config['pid-file'])
             if not os.path.exists(piddir):
                 os.makedirs(piddir)