From 52ec5b600f0886c7a228d641b2a19c1bea7ac68b Mon Sep 17 00:00:00 2001 From: Jeena Date: Sun, 17 May 2026 06:13:35 +0000 Subject: [PATCH] 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. --- systemd/service-update-alerts.service | 3 +++ 1 file changed, 3 insertions(+) diff --git a/systemd/service-update-alerts.service b/systemd/service-update-alerts.service index 750cb4e..97f0ec6 100644 --- a/systemd/service-update-alerts.service +++ b/systemd/service-update-alerts.service @@ -1,7 +1,10 @@ [Unit] Description=Check hosted services for updates +After=network-online.target +Wants=network-online.target [Service] Type=oneshot 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