[PATCH] lighttpd: errorlog failed as non root user 120/head
authorchris5560 <christian.schoenebeck@gmail.com>
Wed, 23 Jul 2014 19:50:16 +0000 (21:50 +0200)
committerchris5560 <christian.schoenebeck@gmail.com>
Wed, 23 Jul 2014 19:50:16 +0000 (21:50 +0200)
if running as non root user (what's should be the default on web-servers) you get:
(log.c.118) opening errorlog '/var/log/lighttpd/server.log' failed: Permission denied

Fix: create log directory only if not exist and chmod 777 to allow anyone
to write and create files inside default log directory

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
net/lighttpd/files/lighttpd.init

index d73a5da98da4ad61401720939da85480f30d5266..b318a023d987e1906b31300a027c885a4699efbd 100644 (file)
@@ -6,7 +6,8 @@ SERVICE_USE_PID=1
 START=50
 
 start() {
-       mkdir -m 0755 -p /var/log/lighttpd
+       [ -d /var/log/lighttpd ] || mkdir -p /var/log/lighttpd
+       chmod 0777 /var/log/lighttpd
        service_start /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
 }