mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-05-16 02:13:32 +00:00
Change After=network.target to After=network-online.target + Wants=network- online.target in both service templates and install_web_service.sh. network.target only means 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 all first-update API calls to fail with "Network is unreachable" or DNS resolution errors. network-online.target waits for a confirmed network route before the service starts. On Raspberry Pi OS this is provided by NetworkManager-wait-online. The tradeoff is a few extra seconds at boot, which is acceptable for a display device. Applied live to /etc/systemd/system/ledmatrix.service on devpi via systemctl daemon-reload (no restart required for the config change to take effect on next boot). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
904 B
Desktop File
30 lines
904 B
Desktop File
# This is a template file. The actual service file is generated dynamically
|
|
# by install_web_service.sh with the correct paths based on where the project
|
|
# is installed. Do not use this file directly - use install_web_service.sh instead.
|
|
#
|
|
# Template - paths will be replaced dynamically:
|
|
# __PROJECT_ROOT_DIR__ will be replaced with the actual project directory
|
|
|
|
[Unit]
|
|
Description=LED Matrix Web Interface Service
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=root
|
|
WorkingDirectory=__PROJECT_ROOT_DIR__
|
|
Environment=USE_THREADING=1
|
|
ExecStart=/usr/bin/python3 __PROJECT_ROOT_DIR__/scripts/utils/start_web_conditionally.py
|
|
Restart=on-failure
|
|
RestartSec=10
|
|
StandardOutput=syslog
|
|
StandardError=syslog
|
|
SyslogIdentifier=ledmatrix-web
|
|
# Automatically create and manage cache directory
|
|
CacheDirectory=ledmatrix
|
|
CacheDirectoryMode=0775
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|