resolvconf support failed for net-misc/networkmanager-1.32.10-r1 Wrong src_configure() meson argument for resolvconf support Reproducible: Always
--- a/net-misc/networkmanager/networkmanager-1.32.10-r1.ebuild +++ b/net-misc/networkmanager/networkmanager-1.32.10-r1.ebuild @@ -217,7 +217,6 @@ multilib_src_configure() { -Difcfg_rh=false -Difupdown=false - $(meson_native_use_feature resolvconf) -Dnetconfig=disable -Dconfig_dns_rc_manager_default=symlink @@ -277,6 +276,10 @@ multilib_src_configure() { emesonargs+=( -Dcrypto=gnutls ) fi + if use resolvconf; then + emesonargs+=( -Dresolvconf=/sbin/resolvconf ) + fi + # Same hack as net-dialup/pptpd to get proper plugin dir for ppp, bug #519986 if use ppp; then local PPPD_VER=`best_version net-dialup/ppp`
I have applied the patch, but it didn't work for me. I could see the added configuration parameters in the build log, but NetworkManager after restart didn't appear to be using resolvconf (unlike previous version, networkmanager-1.32.4-r1). Upon further investigation, I have found that besides being compiled with resolvconf support, NetworkManager also has to be instructed to use it. Specifically, 'rc-manager' option should be set to either 'auto' or 'resolvconf'. I have found two alternative working solutions: 1) Add configuration file /etc/NetworkManager/conf.d/resolvconf.conf with contents [main] rc-manager=resolvconf 2) In the ebuild, in the argument 'config_dns_rc_manager_default=symlink' replace 'symlink' with 'auto' or 'resolvconf'; or, rather, remove this argument completely, because 'auto' appears to be the default default. So, unless there was a specific reason for overriding this default (previous versions of ebuild didn't touch it), I suggest changing Andrey's patch as follows: --- a/net-misc/networkmanager/networkmanager-1.32.10-r1.ebuild +++ b/net-misc/networkmanager/networkmanager-1.32.10-r1.ebuild @@ -217,9 +217,7 @@ -Difcfg_rh=false -Difupdown=false - $(meson_native_use_feature resolvconf) -Dnetconfig=disable - -Dconfig_dns_rc_manager_default=symlink $(meson_feature dhclient) -Ddhcpcanon=disable @@ -277,6 +275,10 @@ emesonargs+=( -Dcrypto=gnutls ) fi + if use resolvconf; then + emesonargs+=( -Dresolvconf=/sbin/resolvconf ) + fi + # Same hack as net-dialup/pptpd to get proper plugin dir for ppp, bug #519986 if use ppp; then local PPPD_VER=`best_version net-dialup/ppp`
Also, I have noticed that the ebuild uses 'disable' for some configuration arguments and 'disabled' for others (via meson_feature function). Is it correct? According to this code from NetworkManager-1.32.10/meson.build, for 'netconfig' option it should be neither 'disable' nor 'disabled', but just 'no': … foreach prog_name : ['resolvconf', 'netconfig'] prog_path = get_option(prog_name) prog_enable = (prog_path != 'no') if prog_enable if prog_path == '' prog = find_program(prog_name, … With '-Dnetconfig=disable' the string 'disable' is interpreted as a path for the netconfig program. It should be '-Dnetconfig=no' instead. I suspect that similar problem should appear with 'dhclient', 'dhcpcd', and 'dhcpcanon' family. Passing '-Ddhcpcanon=disable' or '-Ddhclient=disabled' (via meson_feature function) does not appear to be a correct way to disable features, at least not with this meson script. It should be '-Ddhcpcanon=no' and '-Ddhclient=no'. And if these features are to be enabled, the path to the corresponding program should be supplied as the value, not 'enabled'.
I am hoping this bug also explains why openconnect VPN misbehaves in 1.32.x Currently only 1.30.x works properly for me. Using elogind/resolvconf.
This particular bug is present only in networkmanager-1.32.10-r1 ebuild, since it uses different build system, meson, as opposed to traditional configure script used in networkmanager-1.32.8-r1 ebuild and before. So, if networkmanager-1.32.8-r1 and networkmanager-1.32.4-r1 don't work for you, it is probably a different bug.
1.32.12 went into the tree with the same bug. Maybe update subject to 1.32.12 ?
The same bug with networkmanager-1.32.12.ebuild Steps to reproduce for net-misc/networkmanager-1.32.12[resolvconf] cat > /etc/NetworkManager/NetworkManager.conf <<EOF [main] dns=default rc-manager=resolvconf systemd-resolved=false EOF strace -e access -p $(< /run/NetworkManager/NetworkManager.pid) 2>&1 |grep 'resolvconf\|enabled' nmcli con down MyEthernet1 nmcli con up MyEthernet1 Actual results: access("enabled", X_OK) = -1 ENOENT (No such file or directory) access("enabled", X_OK) = -1 ENOENT (No such file or directory) Expected results: access("/sbin/resolvconf", X_OK) = 0 access("/sbin/resolvconf", X_OK) = 0
After I upgraded to the net-misc/networkmanager-1.32.12 I lost access to Internet, found no nameserver line present in the /etc/resolv.conf file. Using a suggested change in the Comment 2 fixed it, used the -Dconfig_dns_rc_manager_default=auto variant. I am expecting much more people complaining about this.
Created attachment 746082 [details, diff] networkmanager-1.32.12.ebuild.patch I have rewritten the patch to conform to what networkmanager's meson.build script expects of 'resolvconf' and similar options (path to the executable if the feature is enabled, 'no' if it is disabled). I had to hardcode executable paths of resolvconf, dhclient and dhcpcd in the ebuild, though. Also, I have little idea of how this works with multilib, that is, which options should be 'native'-only and which shouldn't. In that regard, I have preserved the previous behavior. And I didn't actually test the ebuild with USE="dhclient" or USE="dhcpcd" (except for configure stage, which looks ok).
This bug has bothered me since 1.32.10, too. A simple symlink from /run/Networkmanager/resolv.conf /run/resolconf/interfaces/Networkmanager did fix it for me everytime. But it bothered me. The proposed fix works for me.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bba90739cd6a491fb938ed38e1462975d720f583 commit bba90739cd6a491fb938ed38e1462975d720f583 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-10-28 03:21:35 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-10-28 03:21:35 +0000 net-misc/networkmanager: fix resolvconf logic in Meson port (unkeyworded) Thakns-to: July Tikhonov <july.tikh@gmail.com> Bug: https://bugs.gentoo.org/816210 Signed-off-by: Sam James <sam@gentoo.org> .../networkmanager-1.32.12-r1.ebuild | 401 +++++++++++++++++++++ 1 file changed, 401 insertions(+)
Please test the unkeyworded 1.32.12-r1 ebuild. It's not 100% clear to me if there's actually a few issues here (wrt dhcp*) but in any case, give this a whirl, and we can see if we need to refine the ebuild afterwards if we know this actually works.
Just did a ebuild configre pass to look at the output, looks good. Noted one small item though: nmrundir: /var/run/NetworkManager I think that should be nmrundir: /run/NetworkManager One question too, those various paths, should they have an EPREFIX added too them as in ${EPREFIX}/sbin/resolvconf ?
(In reply to Joakim Tjernlund from comment #13) > Just did a ebuild configre pass to look at the output, looks good. > Noted one small item though: nmrundir: /var/run/NetworkManager > I think that should be nmrundir: /run/NetworkManager > Yeah, I think so too. > One question too, those various paths, should they have an EPREFIX added > too them as in ${EPREFIX}/sbin/resolvconf ? Yeah, I think they should, although I didn't want to meddle with it _yet_, this is a good point to consider before we keyword it again.
networkmanager-1.32.12-r1 works for me (resolvconf and dhcpcd enabled)
(In reply to Andrey Volkov from comment #15) > networkmanager-1.32.12-r1 works for me (resolvconf and dhcpcd enabled) For me, it also made resolvconf support work again
Thanks both. I suppose we can keyword this shortly.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e2d153f98141010ccc42acdbc6ef5d451aeb31a commit 7e2d153f98141010ccc42acdbc6ef5d451aeb31a Author: Sam James <sam@gentoo.org> AuthorDate: 2021-12-07 00:32:23 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-12-07 00:32:23 +0000 net-misc/networkmanager: keyword 1.32.12-r1 Closes: https://bugs.gentoo.org/816210 Signed-off-by: Sam James <sam@gentoo.org> net-misc/networkmanager/networkmanager-1.32.12-r1.ebuild | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)