Files
pmaports-rtwo/extra-repos/systemd/postmarketos-base-systemd/rootfs-usr-lib-systemd-resolved.conf.d-10-disable-mdns.conf
Clayton Craft 2b05e6da6b systemd/postmarketos-base-systemd: symlink resolv.conf to resolved stub
This logic is "borrowed" from Fedora, and replaces /etc/resolv.conf with
a symlink to the systemd-resolved stub. Fedora does this from an install
script, but that doesn't work for image-based installs since those never
run install scripts on the device, and /etc persists across updates.
I've also seen cases in testing where the symlink was removed by e.g.
accidentally running resolvconf or something similar. So
this runs from a oneshot unit at boot instead, which is ordered before
network-pre.target so NetworkManager doesn't get there first. The old
resolved.post-install script is dropped since the unit covers both cases.

There are some conditions where resolv.conf is **not** replaced:

- when resolv.conf is already a symlink
- when systemd-resolved isn't enabled
- when its stub listener is disabled (via DNSStubListener= in config)
- when systemd isn't running, since resolved isn't either and replacing
  resolv.conf would just break dns (e.g. when running the unit's script
  by hand)
- when resolv.conf is a bind mount (e.g. in a chroot or container)

This assumes that if a user/sys admin wants to hand-roll their own
resolv.conf, that they either disable the systemd-resolved unit or
disable the stub listener in config if they want to use foreign mode.

The resolved drop-ins are also renamed with a 10- prefix, to match the
numbering ranges UAPI.6 recommends for vendor config in /usr.

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9109>
2026-08-08 20:02:10 +00:00

5 lines
128 B
Plaintext

[Resolve]
# CUPS doesn't work with systemd-resolved's mdns:
# https://github.com/OpenPrinting/libcups/issues/81
MulticastDNS=no