Files
basementhud/overlay/etc/dhcp/dhclient-enter-hooks
Dustin C. Hatch 4f49686ff1
All checks were successful
basementhud/pipeline/head This commit looks good
Fix dhclient removing the IP address on renew
For some reason, `dhclient` fires an *EXPIRE* event every time it renews
the DHCP lease, even if the lease has not expired.  `dhclient-script`
then removes the IP address from the interface, which of course breaks
the connection to the NBD server and blocks all reads from the root
filesystem.  To avoid this strange situation, we need to stop
`dhclient-script` acting on the *EXPIRE* event.  Luckily, it provides a
"hook" mechanism that we can use; since the hook script is dot-sourced,
we can just `exit` the process to avoid any further changes in that run.
2022-04-06 16:46:44 -05:00

8 lines
282 B
Plaintext

# Avoid handling the EXPIRE event, which would ordinarily result in the
# IP address being removed from the interface. `dhclient` fires the
# EXPIRE event every time it renews the lease, even if the lease has not
# actually expired.
if [ "${reason}" = EXPIRE ]; then
exit 0
fi