Also account for /var/log/lighttpd file name changes

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2022-06-12 13:37:39 +01:00
parent 1900d567c9
commit f17898bf6f
No known key found for this signature in database
GPG Key ID: 872950F3ECF2B173
5 changed files with 10 additions and 10 deletions

View File

@ -21,7 +21,7 @@ RUN bash -ex install.sh 2>&1 && \
ARG PHP_ENV_CONFIG
ENV PHP_ENV_CONFIG /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
ARG PHP_ERROR_LOG
ENV PHP_ERROR_LOG /var/log/lighttpd/error.log
ENV PHP_ERROR_LOG /var/log/lighttpd/error-pihole.log
COPY ./start.sh /
COPY ./bash_functions.sh /

View File

@ -2,4 +2,4 @@
s6-echo "Starting lighttpd-access-log"
s6-setuidgid www-data cat /var/log/lighttpd/access.log 2>&1
s6-setuidgid www-data cat /var/log/lighttpd/access-pihole.log 2>&1

View File

@ -2,4 +2,4 @@
s6-echo "Starting lighttpd-error-log"
s6-setuidgid www-data cat /var/log/lighttpd/error.log 2>&1
s6-setuidgid www-data cat /var/log/lighttpd/error-pihole.log 2>&1

View File

@ -4,7 +4,7 @@ s6-echo "Starting lighttpd"
if [[ 1 -eq ${WEBLOGS_STDOUT:-0} ]]; then
#lighthttpd cannot use /dev/stdout https://redmine.lighttpd.net/issues/2731
for fi in /var/log/lighttpd/access.log /var/log/lighttpd/error.log
for fi in /var/log/lighttpd/access-pihole.log /var/log/lighttpd/erro-pihole.log
do
if [[ ! -p ${fi} ]]; then
rm -f ${fi}
@ -17,16 +17,16 @@ if [[ 1 -eq ${WEBLOGS_STDOUT:-0} ]]; then
sleep 2
else
#remove fifo if exists
[[ -p /var/log/lighttpd/access.log ]] && rm -Rf /var/log/lighttpd/access.log
[[ -p /var/log/lighttpd/error.log ]] && rm -Rf /var/log/lighttpd/error.log
[[ -p /var/log/lighttpd/access-pihole.log ]] && rm -Rf /var/log/lighttpd/access-pihole.log
[[ -p /var/log/lighttpd/error-pihole.log ]] && rm -Rf /var/log/lighttpd/error-pihole.log
# install /dev/null log files to ensure they exist (create if non-existing, preserve if existing)
[[ ! -f /var/log/lighttpd/access.log ]] && install /dev/null /var/log/lighttpd/access.log
[[ ! -f /var/log/lighttpd/error.log ]] && install /dev/null /var/log/lighttpd/error.log
[[ ! -f /var/log/lighttpd/access-pihole.log ]] && install /dev/null /var/log/lighttpd/access-pihole.log
[[ ! -f /var/log/lighttpd/error-pihole.log ]] && install /dev/null /var/log/lighttpd/error-pihole.log
# Ensure that permissions are set so that lighttpd can write to the logs
chown -R www-data:www-data /var/log/lighttpd
chmod 0644 /var/log/lighttpd/access.log /var/log/lighttpd/error.log
chmod 0644 /var/log/lighttpd/access-pihole.log /var/log/lighttpd/error-pihole.log
fi
lighttpd -D -f /etc/lighttpd/lighttpd.conf

View File

@ -162,7 +162,7 @@ def test_dns_interface_override_defaults(docker, slow, args_env, expected_stdout
expected_debian_lines = [
'"VIRTUAL_HOST" => "127.0.0.1"',
'"ServerIP" => "127.0.0.1"',
'"PHP_ERROR_LOG" => "/var/log/lighttpd/error.log"'
'"PHP_ERROR_LOG" => "/var/log/lighttpd/error-pihole.log"'
]