Skip to content

Commit a26965d

Browse files
committed
feat(dnsmasq): upgrade to Debian forky and add --conf-poll patch
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.
1 parent 28edf04 commit a26965d

3 files changed

Lines changed: 485 additions & 37 deletions

File tree

containers/dnsmasq/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# syntax=docker/dockerfile:1
2-
FROM debian:bookworm-20240408-slim AS builder
2+
FROM debian:forky-20260623-slim AS builder
33

44
ENV DEBFULLNAME="Marek Skrobacki"
55
ENV DEBEMAIL="marek.skrobacki@rackspace.co.uk"
66
ENV QUILT_PATCHES=debian/patches
77

8-
RUN echo "deb-src http://deb.debian.org/debian bookworm main" > /etc/apt/sources.list
8+
RUN echo "deb-src http://deb.debian.org/debian forky main" > /etc/apt/sources.list
99
RUN apt-get update && apt-get -y install \
1010
build-essential \
1111
devscripts \
@@ -21,21 +21,24 @@ RUN apt-get update && apt-get -y install \
2121
WORKDIR /src
2222
RUN apt-get -y build-dep dnsmasq
2323
RUN apt-get -y source dnsmasq
24-
# copy in our patch
24+
# copy in our patches
2525
COPY containers/dnsmasq/dnsmasq/dhcp-allowed-srvids.patch /src/
26-
# setup the patch to be built into the quilt file
26+
COPY containers/dnsmasq/dnsmasq/conf-poll.patch /src/
27+
# setup the patches to be built into the quilt file
2728
# set our version number to a local override suffixed by '.uc1'
2829
RUN cd /src/dnsmasq-* && \
2930
mkdir -p debian/patches && \
3031
mv /src/dhcp-allowed-srvids.patch debian/patches && \
31-
dch -l .uc "patched for dhcp-allowed-srvids" && \
32+
mv /src/conf-poll.patch debian/patches && \
33+
dch -l .uc "patched for dhcp-allowed-srvids and conf-poll" && \
3234
echo dhcp-allowed-srvids.patch >> debian/patches/series && \
35+
echo conf-poll.patch >> debian/patches/series && \
3336
quilt push -a
3437
# build it
3538
RUN cd /src/dnsmasq-* && dpkg-buildpackage -rfakeroot
3639

3740

38-
FROM debian:bookworm-20240408-slim AS prod
41+
FROM debian:forky-20260623-slim AS prod
3942

4043
LABEL org.opencontainers.image.description="dnsmasq for Understack's Ironic"
4144

0 commit comments

Comments
 (0)