From 43e44deb957e2c8886d86fbbab66dfd094af7bb9 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 10 Jul 2026 11:57:14 +0200 Subject: [PATCH] Fix BirdNET-Pi standalone PHP startup --- birdnet-pi/rootfs/custom-services.d/00-php_pfm.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/birdnet-pi/rootfs/custom-services.d/00-php_pfm.sh b/birdnet-pi/rootfs/custom-services.d/00-php_pfm.sh index db5117b0a4..3d36e0b8e1 100755 --- a/birdnet-pi/rootfs/custom-services.d/00-php_pfm.sh +++ b/birdnet-pi/rootfs/custom-services.d/00-php_pfm.sh @@ -4,12 +4,13 @@ # Correct /config permissions after startup chown pi:pi /config -# Waiting for dbus -until [[ -e /var/run/dbus/system_bus_socket ]]; do - sleep 1s -done +# D-Bus is not guaranteed to be available in standalone Docker mode. Use the +# configured TZ directly and only query timedatectl when its bus is ready. +TZ_VALUE="${TZ:-}" +if [[ -S /var/run/dbus/system_bus_socket ]] && command -v timedatectl > /dev/null 2>&1; then + TZ_VALUE="$(timedatectl show -p Timezone --value 2> /dev/null || true)" +fi +export TZ="${TZ_VALUE:-Etc/UTC}" -TZ_VALUE="$(timedatectl show -p Timezone --value)" -export TZ="$TZ_VALUE" -echo "Starting service: php pfm" +echo "Starting service: php fpm" exec /usr/sbin/php-fpm* -F