From f17898bf6f402268a626e7e24c7dab14635cfdde Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 12 Jun 2022 13:37:39 +0100 Subject: [PATCH] Also account for /var/log/lighttpd file name changes Signed-off-by: Adam Warner --- Dockerfile | 2 +- .../etc/services.d/lighttpd-access-log/run | 2 +- s6/debian-root/etc/services.d/lighttpd-error-log/run | 2 +- s6/debian-root/etc/services.d/lighttpd/run | 12 ++++++------ test/test_bash_functions.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5cd5d9c..067f969 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 / diff --git a/s6/debian-root/etc/services.d/lighttpd-access-log/run b/s6/debian-root/etc/services.d/lighttpd-access-log/run index 1473767..61d7cbb 100644 --- a/s6/debian-root/etc/services.d/lighttpd-access-log/run +++ b/s6/debian-root/etc/services.d/lighttpd-access-log/run @@ -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 diff --git a/s6/debian-root/etc/services.d/lighttpd-error-log/run b/s6/debian-root/etc/services.d/lighttpd-error-log/run index c0636fc..45e666a 100644 --- a/s6/debian-root/etc/services.d/lighttpd-error-log/run +++ b/s6/debian-root/etc/services.d/lighttpd-error-log/run @@ -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 diff --git a/s6/debian-root/etc/services.d/lighttpd/run b/s6/debian-root/etc/services.d/lighttpd/run index 2cd314a..98140b4 100644 --- a/s6/debian-root/etc/services.d/lighttpd/run +++ b/s6/debian-root/etc/services.d/lighttpd/run @@ -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 diff --git a/test/test_bash_functions.py b/test/test_bash_functions.py index 6898072..ebdfce1 100644 --- a/test/test_bash_functions.py +++ b/test/test_bash_functions.py @@ -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"' ]