[config] run time directory created when necessary on startup, don't check it exists while creating the instance (closes #1177687)
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 12 Jul 2010 12:55:43 +0200
changeset 5960 ffa38c4ec592
parent 5959 1ce09206a3a3
child 5961 0d5dc7c33c11
[config] run time directory created when necessary on startup, don't check it exists while creating the instance (closes #1177687)
cwconfig.py
--- a/cwconfig.py	Mon Jul 12 12:28:44 2010 +0200
+++ b/cwconfig.py	Mon Jul 12 12:55:43 2010 +0200
@@ -914,10 +914,14 @@
         """return default path to the pid file of the instance'server"""
         if self.mode == 'system':
             # XXX not under _INSTALL_PREFIX, right?
-            rtdir = env_path('CW_RUNTIME_DIR', '/var/run/cubicweb/', 'run time')
+            default = '/var/run/cubicweb/'
         else:
             import tempfile
-            rtdir = env_path('CW_RUNTIME_DIR', tempfile.gettempdir(), 'run time')
+            default = tempfile.gettempdir()
+        # runtime directory created on startup if necessary, don't check it
+        # exists
+        rtdir = env_path('CW_RUNTIME_DIR', default, 'run time',
+                         checkexists=False)
         return join(rtdir, '%s-%s.pid' % (self.appid, self.name))
 
     # instance methods used to get instance specific resources #############