912 |
912 |
913 def default_pid_file(self): |
913 def default_pid_file(self): |
914 """return default path to the pid file of the instance'server""" |
914 """return default path to the pid file of the instance'server""" |
915 if self.mode == 'system': |
915 if self.mode == 'system': |
916 # XXX not under _INSTALL_PREFIX, right? |
916 # XXX not under _INSTALL_PREFIX, right? |
917 rtdir = env_path('CW_RUNTIME_DIR', '/var/run/cubicweb/', 'run time') |
917 default = '/var/run/cubicweb/' |
918 else: |
918 else: |
919 import tempfile |
919 import tempfile |
920 rtdir = env_path('CW_RUNTIME_DIR', tempfile.gettempdir(), 'run time') |
920 default = tempfile.gettempdir() |
|
921 # runtime directory created on startup if necessary, don't check it |
|
922 # exists |
|
923 rtdir = env_path('CW_RUNTIME_DIR', default, 'run time', |
|
924 checkexists=False) |
921 return join(rtdir, '%s-%s.pid' % (self.appid, self.name)) |
925 return join(rtdir, '%s-%s.pid' % (self.appid, self.name)) |
922 |
926 |
923 # instance methods used to get instance specific resources ############# |
927 # instance methods used to get instance specific resources ############# |
924 |
928 |
925 def __init__(self, appid, debugmode=False): |
929 def __init__(self, appid, debugmode=False): |