Merge pull request #991 from pi-hole/tweak/lighttpd-run

Touch/chown lighttpd access/error logs on service start
This commit is contained in:
Adam Warner 2022-01-26 18:30:49 +00:00 committed by GitHub
commit a29faad9df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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