[repo server] fix startup bug, lgc.daemon.daemonize return 1 for the parent process, not -1 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Jun 2010 09:42:24 +0200
branchstable
changeset 5692 59ceed788bdb
parent 5690 6de8437b06bd
child 5693 8af6623f3d4e
[repo server] fix startup bug, lgc.daemon.daemonize return 1 for the parent process, not -1
server/server.py
server/serverctl.py
--- a/server/server.py	Wed Jun 09 09:41:36 2010 +0200
+++ b/server/server.py	Wed Jun 09 09:42:24 2010 +0200
@@ -25,8 +25,6 @@
 import warnings
 from time import localtime, mktime
 
-from logilab.common.daemon import daemonize
-
 from cubicweb.cwconfig import CubicWebConfiguration
 from cubicweb.server.repository import Repository
 
--- a/server/serverctl.py	Wed Jun 09 09:41:36 2010 +0200
+++ b/server/serverctl.py	Wed Jun 09 09:42:24 2010 +0200
@@ -539,14 +539,14 @@
         debug = self.config.debug
         # create the server
         server = RepositoryServer(config, debug)
-        # go ! (don't daemonize in debug mode)
-        pidfile = 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)
+        pidfile = config['pid-file']
         piddir = os.path.dirname(pidfile)
+        # go ! (don't daemonize in debug mode)
         if not os.path.exists(piddir):
             os.makedirs(piddir)
-        if not debug and daemonize(pidfile) == -1:
+        if not debug and daemonize(pidfile):
             return
         uid = config['uid']
         if uid is not None: