[Unit]
Description=LED Controller web server
# Use network.target only. Ordering after network-online.target can block `systemctl start`
# until wait-online finishes; Wi‑Fi/DHCP delays then look like a hung start job.
After=network.target

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/led-controller
Environment=PORT=80
Environment=PATH=/home/pi/.local/bin:/usr/local/bin:/usr/bin:/bin
ExecStart=/bin/bash /home/pi/led-controller/scripts/start.sh
Restart=on-failure
RestartSec=5
# pipenv/first bind can be slow; avoid misleading "activating" forever if misconfigured
TimeoutStartSec=120

[Install]
WantedBy=multi-user.target
