Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 345281 - sys-apps/baselayout: net.wlan0 and dbus init.d dependencies when net-wireless/wpa_supplicant built with USE=dbus
Summary: sys-apps/baselayout: net.wlan0 and dbus init.d dependencies when net-wireless...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-13 11:52 UTC by Bertjan Broeksema
Modified: 2021-01-18 14:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bertjan Broeksema 2010-11-13 11:52:15 UTC
For some time now I've a usb wireless stick in my normal pc in stead of a wired connection to my router. I had all the time this annoyance that net.wlan0 refused to get associated with my wireless network (and therefore refused to get an ip address as well, obviously). It always needed a manual restart of net.wlan0.

My configuration is rather straight forward:

=== /etc/conf.d/net ===
dns_domain_lo="broeksemaatjes.nl"
modules=( "wpa_supplicant" )
wpa_supplicant_wlan0="-Dwext"
modules_wlan0="dhcpcd"
===

=== /etc/wpa_supplicant/wpa_supplicant.conf ===
# De onderstaande regel mag niet aangepast
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
ap_scan=0

network={
  ssid="MyESSID"
  proto=WPA
  key_mgmt=WPA-PSK
  pairwise=CCMP TKIP
  psk="some_pass_phrase"
}
===

And in /etc/conf.d/rc I disable net.eth0 hotpluging

Suddenly I realized that I compiled wpa_supplicant with the dbus use flag enabled and therefore that it might be true that net should depend on dbus. So a I did a quick test:

=== /etc/init.d/net.wlan0 ===
...
depend() {
#        need localmount # Old line, doesn't work
         need localmount dbus # Add dbus for wpa_supplicant
...
===

With this modification it works. That is, now my wireless adapter associates with my network and gets an ip address assigned on startup without manual intervention.

I realize that this is a brute for workaround which shouldn't be this way in portage, but at least I hope it gives some clue on how to fix this problem. I think I've seen this problem more in the fora (though I'm too lazy to provide you with links).

Cheers,

Bertjan




Reproducible: Always

Steps to Reproduce:
1. Make sure net doesn't depend on dbus
2. add net.wlan0 (using wpa_supplicant with dbus flag) to default runlevel
3. (re)boot your system

Actual Results:  
net.wlan0 doesn't get associated with the configured wireless network. Only when restarting net.wlan0 after boot it works correctly.

Expected Results:  
net.wlan0 gets associated with the wireless network at boot time without further manual intervention.

I'm not completely sure if this is related to baselyout but:

this was reproduced with sys-apps/baselayout-1.12.14-r1
Comment 1 SpanKY gentoo-dev 2010-11-14 20:31:42 UTC
i use wpa_supplicant without dbus all the time, so adding the line explicitly all the time isnt going to work
Comment 2 Bertjan Broeksema 2010-11-15 08:16:59 UTC
(In reply to comment #1)
> i use wpa_supplicant without dbus all the time, so adding the line explicitly
> all the time isnt going to work
> 

I explicitly checked this. Without the dbus dependency in net.wlan0, net.wlan0 (can) start before dbus. And for me, if that happens, it will not work. Only when wlan0 starts after dbus it works as expected.
Comment 3 SpanKY gentoo-dev 2010-11-15 09:10:59 UTC
and again, dbus is irrelevant if wpa_supplicant isnt using it.  it might be required in *your* setup, but that doesnt mean it is required all the time.  you're also forgetting that net.wlan0 is a symlink to a net.lo script which works for all interfaces, so adding any specific info to the global script is wrong.  a clean solution is necessary.
Comment 4 Bertjan Broeksema 2010-11-15 09:25:15 UTC
(In reply to comment #3)
> and again, dbus is irrelevant if wpa_supplicant isnt using it.  it might be
> required in *your* setup, but that doesnt mean it is required all the time. 
> you're also forgetting that net.wlan0 is a symlink to a net.lo script which
> works for all interfaces, so adding any specific info to the global script is
> wrong.  a clean solution is necessary.
> 

If you had read my first comment you would have encountered this:

"I realize that this is a brute force workaround which shouldn't be this way in
portage, but at least I hope it gives some clue on how to fix this problem. I
think I've seen this problem more in the fora (though I'm too lazy to provide
you with links)."

I *am* fully aware that the workaround I describe is very specific to my setup and no I did not forget that net.wlan0 is a symlink to net.lo. Nevertheless, a solution needs to be created that solves this particular problem by starting net.* after dbus *if* that is needed.

The main goal of this bug report was to provide a detailed description of a problem and its cause, not to come up with a clean solution. The workaround provided was just to illustrate that it indeed solves the described problem.

Now, I'm not a Gentoo developer, just a user. I know to quite some extend how to use Gentoo. However, to come up with a clean(er) solution I'd need more pointers than just the remark that the current proposal isn't clean. That is, I'm willing to spend some time on investigating for a cleaner solution if someone can give me some pointers about the rough outline how such a solution should look like.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-12-06 02:56:11 UTC
Fix pushed in commit f8f03bd, please test.
Specifically, if the wpa_supplicant help lists DBus, we add in 'need dbus' to the dependencies for that interface.
Comment 6 Bertjan Broeksema 2010-12-07 08:28:40 UTC
(In reply to comment #5)
> Fix pushed in commit f8f03bd, please test.
> Specifically, if the wpa_supplicant help lists DBus, we add in 'need dbus' to
> the dependencies for that interface.

Cool, committed does mean I should get it with the next emerge --sync? Could you post the patch here otherwise?
Comment 7 William Hubbs gentoo-dev 2010-12-07 14:45:12 UTC
(In reply to comment #6)
> Cool, committed does mean I should get it with the next emerge --sync? Could
> you post the patch here otherwise?

I want to fix one more bug, then I'll release 0.6.8, and the fix will be included in 0.6.8.