From: Thierry Parmentelat Date: Mon, 21 Nov 2011 13:33:30 +0000 (+0100) Subject: creates logdir when httpd is not installed X-Git-Tag: sfa-2.0-0~12 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=85608e852e60051a428ab09979fb16dfca8ce65d creates logdir when httpd is not installed --- diff --git a/sfa/server/sfa-start.py b/sfa/server/sfa-start.py index da6eba47..dbd5e4f7 100755 --- a/sfa/server/sfa-start.py +++ b/sfa/server/sfa-start.py @@ -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)