I built networkmanager with -dhclient, so that it uses dhcpcd-5.2.7 for dhcp. Networkmanager-0.8.1-r1 fails to get an IP address, but networkmanager-0.8-r1 does get one.
Created attachment 241793 [details] /var/log/messages of dhcp attempt
version networkmanager-0.8.1-r2 should fix all the issues. Closing this bug now. If you still see this problem, please re-open.
Still fails, using either net-misc/dhcpcd-5.2.7 and net-misc/dhcp-4.1.0 .
Created attachment 243407 [details] using net-misc/dhcp-4.1.0
Created attachment 243409 [details] using net-misc/dhcpcd-5.2.7
Logs suggests you've got dhcpcd client running and NM configured to use dhclient. What packages do you have installed and what use flag enabled for NM? Thanks, Rob
I am having the exact same problem, NM tries to use dhclient instead of dhcp. Please fix quickly as I am dependent on wireless networks and cannot use dhclient. I have dhpcd USE flag enabled and dhcp USE flag is explicitly disabled yet NM still uses dhclient. The previous version (0.8.1-r1) worked perfectly with dhpcd, so what's changed between 0.8.1-r1 and 0.8.1-r3?
I used to have a similar problem after dhcpcd from 5.2.6 to 5.2.7 upgrade. Have you tried killall dhcpcd before attempting to connect using NM?
No, this is definitely not dhcpcd. NetworkManager tries to use dhclient despite being explicitly told not to compile in support for dhclient (dhcp) through its USE flags. I think the ebuild may have left out a patch essential for forcing build with dhcpcd.
This is the automatic selection built into the dhclient code kicking back in again. Between the two versions[1], the networkmanager-0.8.1-dhcp-configure.patch lost the shortening of the search list: --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -63,10 +63,6 @@ const char * nm_dhcp_dhclient_get_path (const char *try_first) { static const char *dhclient_paths[] = { - "/sbin/dhclient", - "/usr/sbin/dhclient", - "/usr/pkg/sbin/dhclient", - "/usr/local/sbin/dhclient", NULL }; const char **path = dhclient_paths; That needs to go back in to ensure that dhclient doesn't automatically look for, find and use a binary just because it's there. [1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-misc/networkmanager/files/networkmanager-0.8.1-dhcp-configure.patch?hideattic=0&r1=1.1&r2=1.2
Excellent, can someone please roll a -r4 ebuild and put it out asap then?
For NetworkManager-0.8.1 and above, both dhcpcd and dhclient could be configured in nm-system-settings.conf. I find the code in main.c: *dhcp_client = g_key_file_get_value (config, "main", "dhcp", NULL); This variable will be used by get_client_type() in nm-dhcp-manager.c. So I think if you add one line to the '[main]' section of your nm-system-settings.conf like: [main] plugins=ifnet,keyfile dhcp=dhcpcd NM would prefer dhcpcd rather than dhclient. This won't require the modification to NM source code and it's a one-time solution. Could anyone test this solution? It works fine on my machine. --- networkmanager-0.8.1-r3.ebuild 2010-08-17 22:39:36.000000000 +0800 +++ networkmanager-0.8.1-r3.ebuild.mod 2010-08-19 12:44:44.000000000 +0800 @@ -62,9 +62,6 @@ # Fix up the dbus conf file to use plugdev group epatch "${FILESDIR}/${P}-confchanges.patch" - # Fix problems with dhcpcd/dhclient (bug #330319) - epatch "${FILESDIR}/${P}-dhcp-configure.patch" - # Backport some important patches epatch "${FILESDIR}/${P}-CVE-2010-1172.patch" epatch "${FILESDIR}/${P}-glib-2.25.12-workaround.patch" @@ -93,6 +90,7 @@ fi else ECONF="${ECONF} --with-dhcpcd" + sed -i '/\[main\]/a dhcp=dhcpcd' ${FILESDIR}/nm-system-settings.conf fi # default is NSS (if none or both are specified), GnuTLS otherwise
Created attachment 243531 [details] Detailed log of NM connection attempts in 3 different scenarios. NetworkManager-0.8.1-r3 probably attempts to use /usr/sbin/dhcpcd net-misc/dhcp (ISC)probably thinking that it is net-misc/dhcpcd (Roy Marples) instead of /sbin/dhcpcd. After I have removed net-misc/dhcp-3.1.2_p1(ISC) it tries to get the IP using the appropriate this time /sbin/dhcpcd but it fails as /sbin/dhcpcd is already running(started at boot time by /etc/init.d/dhcpcd). After killing the dhcpcd process NetworkManager successfully connects using /etc/sbin/dhcpcd. I have attached a detailed log. And I am opening a new bug report for this dhcpcd already running issue.
(In reply to comment #13) > Created an attachment (id=243531) [details] > Detailed log of NM connection attempts in 3 different scenarios. > > NetworkManager-0.8.1-r3 probably attempts to use > /usr/sbin/dhcpcd net-misc/dhcp (ISC)probably > thinking that it is net-misc/dhcpcd (Roy Marples) > instead of /sbin/dhcpcd. > > After I have removed net-misc/dhcp-3.1.2_p1(ISC) > it tries to get the IP using the appropriate > this time /sbin/dhcpcd but it fails as > /sbin/dhcpcd is already running(started at boot time > by /etc/init.d/dhcpcd). > After killing the dhcpcd process NetworkManager successfully > connects using /etc/sbin/dhcpcd. > > I have attached a detailed log. And I am opening a new bug > report for this dhcpcd already running issue. > When NM decide to use dhcpcd or dhclient, it does the following thing: 1. If you defined dhcp=*** in nm-system-settings.conf, *** will be used and done (*** could be dhcpcd or dhclient). 2. If you don't defined dhcp=***(by default now), NM will try to check if you have installed dhclient, if you have, then use it and done. 3. If you don't have dhclient installed, it will try to find dhcpcd, if you have dhcpcd installed, then use it and done. 4. If you don't define dhcp=*** and don't have dhcpcd or dhclient installed, then an error will occur. So I think the simplest solution is define dhcp=*** in nm-system-settings.conf if you have both dhclient and dhcp installed. On the other hand, if you are using NM, why do you still run /etc/init.d/dhcpcd?
well apache depends on /etc/init.d/dhcpcd to be running before it starts. I think this is a bug too. Possibly related to bug #252137. well networking is a bit buggy in Gentoo and we need to improve that part of our favourite distro! This is the bug ID of the newly reported dhcpcd problem #333381
bug #333381 - so it turns into a link (;
IMHO that patch to put it in the nm-system-settings.conf does solve a problem when someone's got both variants installed, but I still think that the USE flags should decide which of the dhcpcd variants to use. Let's have both. The nm-system-settings solution for someone who's got both installed and the patch for people who only want to use ONE of the dhcpcd variants. OK?
Mu Qiao, thanks for the information about the nm-system-settings flag. However, the patch changes are still required to ensure that if networkmanager is compiled without dhclient support that it does not then try to support it anyway. The configure script checks the version of dhclient, and will reject invalid versions, but the runtime checking does not do this, and therefore will accept any dhclient binary, even if it is not supported. This also affects those who try to enable dhclient, but have an unsupported version, since configure will say that dhclient support is not available, but then the runtime check will find the binary and things will still go wrong. Basically the runtime check should adhere to any explicit decision made by the configure script, and it should also check the version of dhclient (as the configure script does). Denysonique, apache2's init script only needs net, not dhcpcd. Also dhcpcd isn't necessary to get a DHCP address using either Gentoo's networking scripts or NetworkManger. If you want to use Gentoo's networking scripts, please read /usr/share/doc/openrc-{VERSION}/net.example. To use networkmanager, you'll need to set up a system connection that starts automatically. Since we're talking about a dynamic address, apache's configuration can't be bound to a particular ip, therefore it doesn't matter which order the two services start. Apache will require the net service to be started, so at least net.lo needs to be running, but apache should start that automatically if necessary. Either way, please ensure that dhcpcd isn't in any of your runlevels.
Please see bug #332157, if the the new configure options are used then the 'dhcpd' and 'dhclient' USE flags are respected. --with-dhclient=[yes|no] --with-dhcpcd=[yes|no] Thanks :)
Can you please let me know if version 0.8.1-r4 from portage tree fixes it for you?
Nope, this is still falling back to using dhclient with USE="-dhclient". Did something change between the two revisions other than the ifnet plugin? I can't see any changes in the ifnet plugin patch that would fix the dhcp autodetect code that was patched as part of 330319 in -r1 and then removed again in -r2/-r3. If the part of the patch that was removed (mentioned in comment 10) isn't acceptable, then let me know why it was removed, and I may be able to code up another fix that won't have whatever the problem might be...
Hi Mike, I've used the patch from upstream, but it seems if not explicitly disabled, dhclient wants to built. As discussed on IRC, I'll patch ebuild to explicitly disable dhclient when -dhclient USE flag defined.
I've pushed another revision to portage tree. Networkmanager-0.8.1-r6 should hopefully fix all dhcpcd/dhclient{3,4} problems we had. Please test and let me know. If you can still see the problems, please re-open this bug.
Thumbs up for this latest ebuild, it doesn't try to use dhclient any more. Many thanks for your hard work in resolving this issue, it's much appreciated!
Works like a charm in -r6, big thanks :)