| Summary: | systemd recipe edits wrong tmpfile.d file for resolv.conf | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Trent Piepho <trent.piepho> |
| Component: | core | Assignee: | Trent Piepho <trent.piepho> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | meta.mr.watcher, meta.watcher, mingli.yu, randy.macleod |
| Version: | 5.0.7 | ||
| Target Milestone: | 5.2 | ||
| Hardware: | x86 | ||
| OS: | x86_64 | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
Another interesting suggestion. Can you send a patch to the list? It's more complex to fix this than it might appear at first. If one changes the conf file to edit to be the correct one, then it creates a new problem. The alternatives system is also used to make /etc/resolv.conf a symlink to /etc/resolv-conf.systemd, or elsewhere, depending on the alternative chosen for it. If the tmpfiles.d conf file is fixed, then tmpfiles will make a direct link from: /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf But at the same time, alternatives is configured to manage the same symlink as: /etc/resolv.conf -> /etc/resolv-conf.systemd So they end up fighting each other. Updating systemd via opkg will try to change the link. But that's not even all of it. If volatile-binds is included, it will use a symlink from /etc/tmpfiles.d/etc.conf to /dev/null to disable to processing of the etc.conf file in /usr/lib/tmpfiles.d. The idea being that files in /etc will be a in a read-only rootfs and tmpfiles.d will fail to make them. As pointed out in the initial bug result, since systemd 250 this link is not in the etc.conf file anymore and so is no longer masked by volatile-binds. Adding my co-worker Mingli who may be able to help 'resolv(.conf)" this issue. I have tested that the system one gets now works with Network Manager. This matters, because NetworkManager uses the link target of /etc/resolv.conf to determine the resolve configuration. It doesn't just lstat("/etc/resolv.conf"), but instead follows all the links and if the final file is "/run/systemd/resolve/…" then it detects systemd-resolved mode.
And in case it's not clear, what one gets now is a two link chain:
/etc/resolv.conf -> /etc/resolv-conf.systemd
/etc/resolv-conf.systemd -> ../run/systemd/resolve/{stub-,}resolv.conf
The former link from alternatives and the latter link from the systemd install recipe case for systemd-resolved configuration.
Apprently works. I not aware of tha commit that changed things... It's in this commit, https://github.com/systemd/systemd/commit/b15f6eae421ad64773c0be934fd372d1ca230adb It's clear it the file the link is in is changing, and the yocto recipe was never updated to edit this file. |
The systemd recipe will use sed to try to edit the tmpfiles.d created symlink from /etc/resolv.conf when using systemd-resolved. However, it tries to edit ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf This is the wrong fine since systemd 250. It should now be systemd-resolve.conf