Seems like commit fcd48092d7bcab0cad2606e65332da62420935ad (From OE-Core rev: 4a44a7658cebafab336f061f270b6ff44150a6d6) shadowed tmpfiles.d/etc.conf provided by systemd recipe. If resolved is enabled in systemd, at least creating a symlink from /etc/resolv.conf to /run/systemd/resolve/resolv.conf is required for resolution to work as expected. root@raspberrypi3:~# systemd-resolve google.com google.com: 216.58.205.78 -- Information acquired via protocol DNS in 226.7ms. -- Data is authenticated: no while... root@raspberrypi3:~# ping google.com ping: bad address 'google.com' Putting the aforementioned symlink in place bring back the expected behaviour. Did not investigate if any other shadowed tmpfile.d affects normal operation.
Maxin, can you take this one please?
Similar failure in sysvinit as well (/etc/resolv.conf file exists, but it is empty) rm: cannot remove '/tmp': Read-only file system rm: cannot remove '/etc/resolv.conf': Read-only file system ln: failed to create symbolic link '/etc/resolv.conf': Read-only file system INIT: Entering runlevel: 5
We can provide a fix by creating a symlink from /run/systemd/resolve/resolv.conf to /etc/resolv.conf with "resolved" enabled in systemd. However, that breaks the images (eg: core-image-sato) where resolution is handled by connman: https://bugzilla.yoctoproject.org/show_bug.cgi?id=6700 The workaround for this bug was to disable "resolved" and "networkd" in systemd. +PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved" +PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
For "read-only" filesystem, creating link from "/var/run/connman/resolv.conf", to "/etc/resolv.conf" fails. # systemctl status systemd-tmpfiles-setup.service [[0;1;31m●[[0m systemd-tmpfiles-setup.service - Create Volatile Files and Directories Loaded: loaded (/lib/systemd/system/systemd-tmpfiles-setup.service; static; vendor preset: enabled) Active: [[0;1;31mfailed[[0m (Result: exit-code) since Thu 2017-06-08 12:53:56 UTC; 36s ago Docs: man:tmpfiles.d(5) man:systemd-tmpfiles(8) Process: 366 ExecStart=/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev [[0;1;31m(code=exited, status=1/FAILURE)[[0m Main PID: 366 (code=exited, status=1/FAILURE) Jun 08 12:53:56 qemux86-64 systemd[1]: Starting Create Volatile Files and Directories... Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;31msymlink(/var/run/connman/resolv.conf, /etc/resolv.conf) failed: Read-only file system[[0m Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;39m"/var/log" already exists and is not a directory.[[0m Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;39m"/var/tmp" already exists and is not a directory.[[0m Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;39msystemd-tmpfiles-setup.service: Main process exited, code=exited, status=1/FAILURE[[0m Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;31mFailed to start Create Volatile Files and Directories.[[0m Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;39msystemd-tmpfiles-setup.service: Unit entered failed state.[[0m Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;39msystemd-tmpfiles-setup.service: Failed with result 'exit-code'.[[0m
(In reply to comment #4) > For "read-only" filesystem, creating link from > "/var/run/connman/resolv.conf", to "/etc/resolv.conf" fails. > > > # systemctl status systemd-tmpfiles-setup.service > > [[0;1;31m●[[0m systemd-tmpfiles-setup.service - Create Volatile Files and > Directories > Loaded: loaded (/lib/systemd/system/systemd-tmpfiles-setup.service; > static; vendor preset: enabled) > Active: [[0;1;31mfailed[[0m (Result: exit-code) since Thu 2017-06-08 > 12:53:56 UTC; 36s ago > Docs: man:tmpfiles.d(5) > man:systemd-tmpfiles(8) > Process: 366 ExecStart=/bin/systemd-tmpfiles --create --remove --boot > --exclude-prefix=/dev [[0;1;31m(code=exited, status=1/FAILURE)[[0m > Main PID: 366 (code=exited, status=1/FAILURE) > > Jun 08 12:53:56 qemux86-64 systemd[1]: Starting Create Volatile Files and > Directories... > Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: > [[0;1;31msymlink(/var/run/connman/resolv.conf, /etc/resolv.conf) failed: > Read-only file system[[0m > Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;39m"/var/log" > already exists and is not a directory.[[0m > Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;39m"/var/tmp" > already exists and is not a directory.[[0m > Jun 08 12:53:56 qemux86-64 systemd[1]: > [[0;1;39msystemd-tmpfiles-setup.service: Main process exited, code=exited, > status=1/FAILURE[[0m > Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;31mFailed to start Create > Volatile Files and Directories.[[0m > Jun 08 12:53:56 qemux86-64 systemd[1]: > [[0;1;39msystemd-tmpfiles-setup.service: Unit entered failed state.[[0m > Jun 08 12:53:56 qemux86-64 systemd[1]: > [[0;1;39msystemd-tmpfiles-setup.service: Failed with result 'exit-code'.[[0m placing a symlink to "/dev/null" in "/etc/tmpfiles.d/connman_resolvconf.conf" for read-only-rootfs fixes this one.
Fix sent to oe-core: http://lists.openembedded.org/pipermail/openembedded-core/2017-June/137960.html
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=00e4662e55f66570cae29240c22b4d74b79d3ca5
I reproduced the original test case and can confirm the original issue is fixed by the above patch. Thanks!
*** Bug 11969 has been marked as a duplicate of this bug. ***