From a4110d7d50eddc433da2d0d08a092585f5fe6ee5 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 7 Nov 2026 21:22:01 +0100 Subject: 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. --- src/systemd/dhcp6c@.service | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/systemd/dhcp6c@.service') 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 -- cgit v1.2.3