creates logdir when httpd is not installed
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 21 Nov 2011 13:33:30 +0000 (14:33 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 21 Nov 2011 13:33:30 +0000 (14:33 +0100)
sfa/server/sfa-start.py

index da6eba4..dbd5e4f 100755 (executable)
@@ -61,7 +61,10 @@ def daemon():
     devnull = os.open(os.devnull, os.O_RDWR)
     os.dup2(devnull, 0)
     # xxx fixme - this is just to make sure that nothing gets stupidly lost - should use devnull
-    crashlog = os.open('/var/log/httpd/sfa_access_log', os.O_RDWR | os.O_APPEND | os.O_CREAT, 0644)
+    logdir='/var/log/httpd'
+    # when installed in standalone we might not have httpd installed
+    if not os.path.isdir(logdir): os.mkdir('/var/log/httpd')
+    crashlog = os.open('%s/sfa_access_log'%logdir, os.O_RDWR | os.O_APPEND | os.O_CREAT, 0644)
     os.dup2(crashlog, 1)
     os.dup2(crashlog, 2)