Fix tail yelling about non-existent log files.

This commit is contained in:
Greyscale 2024-04-03 22:55:34 +02:00
parent c08b54c0ad
commit c1d9ba18c5
No known key found for this signature in database
GPG key ID: 74BAFF55434DA4B2
4 changed files with 5 additions and 8 deletions

View file

@ -177,6 +177,7 @@ RUN apt-get -qq update && \
sed -i "s/{{PHP}}/$PHP_VERSION/g" /etc/nginx/sites-enabled/default && \
sed -i "s/{{PHP}}/$PHP_VERSION/g" /etc/nginx/sites-enabled/default-ssl && \
sed -i "s/{{PHP}}/$PHP_VERSION/g" /etc/service/php-fpm/run && \
sed -i "s/{{PHP}}/$PHP_VERSION/g" /etc/service/logs-phpfpm-error/run && \
# Enable PHP-FPM status & PHP-FPM ping
sed -i -e "s|;pm.status_path =.*|pm.status_path = /fpm-status|g" /etc/php/*/fpm/pool.d/www.conf && \
sed -i -e "s|;ping.path =.*|ping.path = /fpm-ping|g" /etc/php/*/fpm/pool.d/www.conf && \

View file

@ -1,2 +1,2 @@
#!/usr/bin/env bash
sleep 1
sleep 5

View file

@ -1,8 +1,2 @@
#!/usr/bin/env bash
# for each php-fpm log file, tail it
# if there are no php-fpm log files, sleep for a second
for i in /var/log/php*-fpm.log; do
if [[ -f ${i} ]]; then
tail -f "${i}" &
fi
done
tail -f /var/log/php{{PHP}}-fpm.log

View file

@ -1,5 +1,7 @@
#!/usr/bin/env bash
touch /var/log/php{{PHP}}-fpm.log
# Load envs into PHP-fpm's env.conf.
# shellcheck disable=SC1083,SC2312
env | sed "s/\(.*\)=\(.*\)/env[\1]='\2'/" >/etc/php/{{PHP}}/fpm/conf.d/env.conf