2026-07-24 03:00 UTC
So, unless I'm misunderstanding things due to a migraine, the Kea DHCP server (as packaged by Ubuntu, using their default systemd config):
1. Doesn't attempt to reconnect if it loses its connection to its database (MySQL, Postgres, etc)
2. *Exits* if it loses its database connection.
3. Isn't configured to have systemd restart it if it exits.
So, basically, if anything causes Postgres to restart (like `apt upgrade`), I lose DHCP until I restart kea-dhcp4-server manually.
Also, static DHCP reservations share the same default lease time as the rest of the devices on the network, and there's no really trivial way to override that. I can't just add `"valid-lifetime": 31500000` or something to each reservation. Instead, it looks like I'd need to use client classes, which is a bit more involved in my config.
Replies (1)
-
@laird@hachyderm.io 2026-07-24 03:02
The first of these is easy to fix, just add something like "reconnect-wait-time": 3000, "max-reconnect-tries": 3, to the `lease-database` block in `kea-dhcp4.conf`. That'll let it try reconnecting after a 3s delay, but it'll still exit if it fails 3x in a row. Getting systemd to restart it is at least a bit better documented.