All of lore.kernel.org
 help / color / mirror / Atom feed
* Systemd recipe breaks resolvconf
@ 2017-03-04 13:33 Martin Townsend
  2017-03-04 19:04 ` Khem Raj
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Townsend @ 2017-03-04 13:33 UTC (permalink / raw)
  To: yocto

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?

I can create a bug report if you think this is a genuine problem.

Cheers,
Martin.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Systemd recipe breaks resolvconf
  2017-03-04 13:33 Systemd recipe breaks resolvconf Martin Townsend
@ 2017-03-04 19:04 ` Khem Raj
  0 siblings, 0 replies; 2+ messages in thread
From: Khem Raj @ 2017-03-04 19:04 UTC (permalink / raw)
  To: Martin Townsend; +Cc: yocto

On Sat, Mar 4, 2017 at 5:33 AM, Martin Townsend <mtownsend1973@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@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-04 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-04 13:33 Systemd recipe breaks resolvconf Martin Townsend
2017-03-04 19:04 ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.