server/serverctl.py
changeset 5696 98d390c28edb
parent 5590 a56eb02f9ce7
parent 5692 59ceed788bdb
child 5754 51179e0bb250
--- a/server/serverctl.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/server/serverctl.py	Wed Jun 09 10:06:46 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: