diff --git a/s6/debian-root/etc/services.d/lighttpd/run b/s6/debian-root/etc/services.d/lighttpd/run index a9b2bf6..a1c45b8 100644 --- a/s6/debian-root/etc/services.d/lighttpd/run +++ b/s6/debian-root/etc/services.d/lighttpd/run @@ -1,4 +1,12 @@ #!/usr/bin/with-contenv bash s6-echo "Starting lighttpd" + +# Touch log files to ensure they exist (create if non-existing, preserve if existing) +touch /var/log/lighttpd/access.log /var/log/lighttpd/error.log + +# Ensure that permissions are set so that lighttpd can write to the logs +chown www-data:www-data /var/log/lighttpd/access.log /var/log/lighttpd/error.log +chmod 0644 /var/log/lighttpd/access.log /var/log/lighttpd/error.log + lighttpd -D -f /etc/lighttpd/lighttpd.conf