Skip to content

feat(dnsmasq): add --conf-poll feature and upgrade to Debian forky#2136

Open
skrobul wants to merge 1 commit into
mainfrom
dnsmasq-polling
Open

feat(dnsmasq): add --conf-poll feature and upgrade to Debian forky#2136
skrobul wants to merge 1 commit into
mainfrom
dnsmasq-polling

Conversation

@skrobul

@skrobul skrobul commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Bump the dnsmasq container to debian:forky-20260623-slim (dnsmasq 2.93-1), which is close enough to our dev tree that both vendored patches now apply cleanly, and rebase dhcp-allowed-srvids.patch onto that version.

Add conf-poll.patch, a new dnsmasq feature (--conf-poll / --conf-poll-interval=<seconds>, default 1s) written to solve a real problem in our Ironic setup: dnsmasq relies on inotify to notice changes to --hostsdir, --dhcp-hostsdir and --dhcp-optsdir. When those directories live on an NFS share and are modified or created by a different NFS client (i.e. not the machine running dnsmasq itself), the local kernel never gets an inotify event for it, so dnsmasq silently keeps serving stale DNS/DHCP data until it's sent a SIGHUP or restarted.

--conf-poll makes dnsmasq additionally stat() those directories on a timer (every --conf-poll-interval seconds) and reload anything that's new, changed, or removed, using the exact same reload logic as an inotify event or SIGHUP would trigger. It runs alongside inotify, not instead of it, so on non-NFS setups where inotify works fine it's just a harmless no-op backup check. It's opt-in and disabled by default, so existing deployments are unaffected unless the option is explicitly set. Deleting a file from --dhcp-hostsdir/--dhcp-optsdir intentionally still does not remove the DHCP config it added, since that already matches how those two options have always behaved in stock dnsmasq.

Related: https://rackspace.atlassian.net/browse/PUC-1729

Bump the dnsmasq container to debian:forky-20260623-slim (dnsmasq
2.93-1), which is close enough to our dev tree that both vendored
patches now apply cleanly, and rebase dhcp-allowed-srvids.patch onto
that version.

Add conf-poll.patch, a new dnsmasq feature (--conf-poll /
--conf-poll-interval=<seconds>, default 1s) written to solve a real
problem in our Ironic setup: dnsmasq relies on inotify to notice
changes to --hostsdir, --dhcp-hostsdir and --dhcp-optsdir. When those
directories live on an NFS share and are modified or created by a
different NFS client (i.e. not the machine running dnsmasq itself),
the local kernel never gets an inotify event for it, so dnsmasq
silently keeps serving stale DNS/DHCP data until it's sent a SIGHUP or
restarted.

--conf-poll makes dnsmasq additionally stat() those directories on a
timer (every --conf-poll-interval seconds) and reload anything that's
new, changed, or removed, using the exact same reload logic as an
inotify event or SIGHUP would trigger. It runs alongside inotify, not
instead of it, so on non-NFS setups where inotify works fine it's just
a harmless no-op backup check. It's opt-in and disabled by default, so
existing deployments are unaffected unless the option is explicitly
set. Deleting a file from --dhcp-hostsdir/--dhcp-optsdir intentionally
still does not remove the DHCP config it added, since that already
matches how those two options have always behaved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant