summaryrefslogtreecommitdiff
path: root/src/systemd
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-11-07 21:22:01 +0100
committerChristian Breunig <christian@breunig.cc>2026-11-07 21:22:01 +0100
commita4110d7d50eddc433da2d0d08a092585f5fe6ee5 (patch)
tree2dd739c7ede3c1ae8353927cd5212cd0c957ae49 /src/systemd
parentd6902e6423ec78b5b99d96b6427ebee771ea6c38 (diff)
downloadvyos-1x-a4110d7d50eddc433da2d0d08a092585f5fe6ee5.tar.gz
vyos-1x-a4110d7d50eddc433da2d0d08a092585f5fe6ee5.zip
dhcpv6-client: T6301: do not block commits on an unanswered Release
When stopped, dhcp6c removes its leases at once but then retransmits the Release for ~30 seconds if the server never replies. As the client is stopped or restarted synchronously, every commit deleting "address dhcpv6", changing "dhcpv6-options" or moving the interface to another VRF hung for that long. Stopping the client now waits at most 5 seconds for it to exit before it is killed, which is treated as a clean stop so the unit does not end up failed. Add a smoketest dropping the Release on a veth pair with a local DHCPv6 server, verifying the commit returns quickly and the lease is removed.
Diffstat (limited to 'src/systemd')
-rw-r--r--src/systemd/dhcp6c@.service4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/systemd/dhcp6c@.service b/src/systemd/dhcp6c@.service
index f634bd944..b991ac345 100644
--- a/src/systemd/dhcp6c@.service
+++ b/src/systemd/dhcp6c@.service
@@ -10,6 +10,10 @@ WorkingDirectory=/run/dhcp6c
EnvironmentFile=-/run/dhcp6c/dhcp6c.%i.options
PIDFile=/run/dhcp6c/dhcp6c.%i.pid
ExecStart=/usr/sbin/dhcp6c $DHCP6C_OPTS
+# T6301: dhcp6c removes all leases at once on SIGTERM, but then waits ~30s for
+# a Reply to its Release. Do not block commits on a server that never answers.
+ExecStop=/bin/sh -c 'kill -TERM ${MAINPID}; timeout 5 tail -s 0.1 --pid=${MAINPID} -f /dev/null || kill -KILL ${MAINPID}'
+SuccessExitStatus=KILL
Restart=always
RestartPreventExitStatus=
RestartSec=10