From d69fcb435214b4525e4ca77e0380edbff4222749 Mon Sep 17 00:00:00 2001 From: Brad Kollmyer Date: Tue, 21 Jul 2026 11:19:37 -0700 Subject: dhcp: T9108: restart dhclient when unicast RENEW is overdue ISC dhclient can sit in unicast RENEW to a server that has lost the session until the lease expires (hours), with the modem link still up. That is distinct from T9085 (successful RENEW that does not reinstall a missing default). Add a lightweight oneshot helper and systemd timer (every 5m) that parses each active interface ISC lease DB: if renew is more than 15 minutes in the past while expire is still in the future, restart dhclient@iface (30m cooldown). Enable the timer from the package postinst. --- src/systemd/vyos-dhclient-lease-watch.service | 10 ++++++++++ src/systemd/vyos-dhclient-lease-watch.timer | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/systemd/vyos-dhclient-lease-watch.service create mode 100644 src/systemd/vyos-dhclient-lease-watch.timer (limited to 'src/systemd') diff --git a/src/systemd/vyos-dhclient-lease-watch.service b/src/systemd/vyos-dhclient-lease-watch.service new file mode 100644 index 000000000..39b3dae60 --- /dev/null +++ b/src/systemd/vyos-dhclient-lease-watch.service @@ -0,0 +1,10 @@ +[Unit] +Description=VyOS DHCPv4 stuck-RENEW watchdog (oneshot) +Documentation=man:dhclient(8) +After=vyos-router.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/python3 /usr/libexec/vyos/vyos-dhclient-lease-watch +SyslogIdentifier=vyos-dhclient-lease-watch +Nice=10 diff --git a/src/systemd/vyos-dhclient-lease-watch.timer b/src/systemd/vyos-dhclient-lease-watch.timer new file mode 100644 index 000000000..133c4b44c --- /dev/null +++ b/src/systemd/vyos-dhclient-lease-watch.timer @@ -0,0 +1,16 @@ +[Unit] +Description=Periodically check for stuck DHCPv4 unicast RENEW +Documentation=man:dhclient(8) +After=vyos-router.service + +[Timer] +# First run a few minutes after boot (leases need to exist) +OnBootSec=3min +# Then every 5 minutes +OnUnitActiveSec=5min +AccuracySec=30s +Persistent=true +Unit=vyos-dhclient-lease-watch.service + +[Install] +WantedBy=timers.target -- cgit v1.2.3