smallest possible change to fix #472806 stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Mon, 05 Oct 2009 18:45:12 +0200
branchstable
changeset 3558 0e478957a9d4
parent 3557 4aa3b3f1c8a9
child 3559 3e64534ffa87
smallest possible change to fix #472806
etwist/server.py
--- a/etwist/server.py	Mon Oct 05 16:15:41 2009 +0200
+++ b/etwist/server.py	Mon Oct 05 18:45:12 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)