From d941c91f2461e1e4abfa18bcbe2bdeb14df8c10e Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Fri, 15 May 2026 15:47:35 -0400 Subject: [PATCH] fix(systemd): wait for network connectivity before starting services (#335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change After=network.target → After=network-online.target + Wants=network- online.target in both service templates and install_web_service.sh. network.target only guarantees NetworkManager has started — it does NOT mean the device has an active internet connection. On boot the LED matrix service was starting within seconds of the network interface appearing, before WiFi association and DHCP completed, causing every first-update API call to fail with "Network is unreachable" or DNS resolution errors. network-online.target waits for a confirmed route before the service fires. On Raspberry Pi OS this is provided by NetworkManager-wait-online. The tradeoff is a few extra seconds at boot, acceptable for a display device. Observed on devpi: service started at 14:48:03, all API calls (weather, FlightRadar24, local ADS-B) failed at 14:48:07 with network errors, then the service restarted cleanly at 14:50:40 once WiFi was established. Co-authored-by: Chuck Co-authored-by: Claude Sonnet 4.6 --- scripts/install/install_web_service.sh | 3 ++- systemd/ledmatrix-web.service | 3 ++- systemd/ledmatrix.service | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/install/install_web_service.sh b/scripts/install/install_web_service.sh index 23575080..6df16d71 100644 --- a/scripts/install/install_web_service.sh +++ b/scripts/install/install_web_service.sh @@ -31,7 +31,8 @@ echo "Generating service file with dynamic paths..." WEB_SERVICE_FILE_CONTENT=$(cat <