fix: Wait for network before running update checks

Catch-up runs triggered shortly after boot by Persistent=true were
failing with DNS resolution errors because NetworkManager had not yet
finished bringing up the network. Add network-online.target ordering
plus a DNS poll for api.github.com so the service starts once name
resolution actually works.
This commit is contained in:
Jeena 2026-05-17 06:13:35 +00:00
parent 6b4b74fc01
commit 52ec5b600f

View file

@ -1,7 +1,10 @@
[Unit] [Unit]
Description=Check hosted services for updates Description=Check hosted services for updates
After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=oneshot Type=oneshot
WorkingDirectory=%h/Projects/service-update-alerts WorkingDirectory=%h/Projects/service-update-alerts
ExecStartPre=/bin/sh -c 'for i in $(seq 1 30); do getent hosts api.github.com >/dev/null 2>&1 && exit 0; sleep 2; done; exit 1'
ExecStart=%h/Projects/service-update-alerts/.venv/bin/python -m update_monitor --services %h/Projects/service-update-alerts/services --auto-update --classify-timeout 300 --script-timeout 300 ExecStart=%h/Projects/service-update-alerts/.venv/bin/python -m update_monitor --services %h/Projects/service-update-alerts/services --auto-update --classify-timeout 300 --script-timeout 300