[yocto] Systemd recipe breaks resolvconf

Khem Raj raj.khem at gmail.com
Sat Mar 4 11:04:08 PST 2017


On Sat, Mar 4, 2017 at 5:33 AM, Martin Townsend <mtownsend1973 at gmail.com> wrote:
> Hi,
>
> I've just tracked down a problem with resolvconf not working on my
> board and it was due to the systemd recipe creating the resolv.conf
> link and patching etc.conf. Here's the snippet (I've taken it from
> krogoth but it is still there in morty).
>
> if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true',
> 'false', d)}; then
>     # if resolved is disabled, it won't handle the link of resolv.conf, so
>     # set it up ourselves
>     ln -s ../run/resolv.conf ${D}${sysconfdir}/resolv.conf
>     echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/resolv.conf'
>>>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
>     echo 'f /run/resolv.conf 0644 root root'
>>>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
> fi
>
> As systemd's resolved is not enabled by default the above is
> happening.  The problem is that it breaks resolvconf which setsup
> /etc/resolv.conf to link to /etc/resolvconf/run/resolv.conf and
> doesn't seem to work when it's not.
>
> I've put an ugly hack in a systemd append that undoes the changes
> above and resolvconf works fine.
>
> Not sure what the best way to fix this, the if statement above should
> say is if ! resolved && image doesn't contain resolvconf but I don't
> think you can do this in do_install.  A DISTRO_FEATURE of resolvconf
> could be added to state that you are going to manage the DNS resolver
> configuration.  The other option is to remove the above if statement.
> Should systemd be setting up /etc/resolv.conf if resolved is not used?
> If you not going to use resolved then you are probably going to use
> something else. Or is this because systemd stops resolv.conf from
> being created? but wouldn't that only happen if you disable SysV Init
> altogether?

somehow the resolv.conf creation needs to get into tmpfiles.d when systemd
is enabled, thats what it tries to do here. If it conflicts with
resolveconf then
lets see if resolveconf can deal with new paths may be with symlinks or so.

>
> I can create a bug report if you think this is a genuine problem.
>
> Cheers,
> Martin.
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list