Discussion:
NetBSD 4.0: wpa_supplicant not starting up at boot time (+ proposed fix)
Ryu Fan
2008-04-23 01:17:56 UTC
Permalink
Hello,

I have installed NetBSD 4.0 on a Dell Latitude CPx, which has a D-Link
WNA-1330 wireless adapter.

---------------------------------------
# uname -a
NetBSD babyima.local 4.0 NetBSD 4.0 (GENERIC_LAPTOP) #0:... i386
---------------------------------------

I've set up WPA per the straightforward instructions available on the
NetBSD wiki. However, I have run into an issue with wpa_supplicant;
what follows is a proposed solution (and a request for ideas for
perhaps a better solution).

Relevant snippet from /etc/rc.conf:
---------------------------------------
wscons=YES
dhclient=YES
wpa_supplicant=YES
wpa_supplicant_flags="-B -i ath0 -c /etc/wpa_supplicant.conf"
---------------------------------------

The issue:
At boot time, wpa_supplicant does not start. After a period of
troubleshooting, I determined that this is because 1) wpa_supplicant
lives in /usr/sbin; 2) the /etc/rc.d/wpa_supplicant script runs before
both the /etc/rc.d/mountcritremote script (which mounts /usr) and the
/etc/rc.d/mountall script. This arrangement means that the
wpa_supplicant binary is not available when the
/etc/rc.d/wpa_supplicant script runs.

My proposed solution:
After some more poking around in /etc/defaults/rc.conf, I decided that
a solution would be to add overrides to /etc/rc.conf. In /etc/rc.conf
now have:
---------------------------------------
critical_filesystems_local="/var /usr"
critical_filesystems_remote=""
---------------------------------------

I tested, and this fixes the problem.

Question:
Is this the appropriate solution? Is there a more proper way to do
this? I am just getting started with NetBSD and I would like to follow
best practices.

Thanks for any help.
--
Best regards -
Ryu Fan // ***@gmail.com
Giles Lean
2008-04-23 03:17:32 UTC
Permalink
Post by Ryu Fan
Is this the appropriate solution? Is there a more proper way to do
this? I am just getting started with NetBSD and I would like to follow
best practices.
It sounds like a reasonable solution given the existing code.

Possibly though wpa_supplicant needs to move out of /usr: if
/usr was remotely mounted via a wireless network that needed
wpa_supplicant to enable it I don't think there would be a
workaround.

Someone may understand this all better than I do, of course,
and I welcome better ideas and even correction if I'm wrong. ;-)

Giles
Ryu Fan
2008-04-25 01:56:44 UTC
Permalink
Thanks to Giles and Holger for the responses. I read through NetBSD PR
#36325; sounds like a good writeup and a reasonable long-term fix.
--
Best regards -
Ryu Fan // ***@gmail.com
Holger Weiss
2008-04-23 10:11:43 UTC
Permalink
Post by Ryu Fan
At boot time, wpa_supplicant does not start. After a period of
troubleshooting, I determined that this is because 1) wpa_supplicant
lives in /usr/sbin; 2) the /etc/rc.d/wpa_supplicant script runs before
both the /etc/rc.d/mountcritremote script (which mounts /usr) and the
/etc/rc.d/mountall script. This arrangement means that the
wpa_supplicant binary is not available when the
/etc/rc.d/wpa_supplicant script runs.
Indeed. I sent a PR some time ago (bin/36325).
Post by Ryu Fan
---------------------------------------
critical_filesystems_local="/var /usr"
critical_filesystems_remote=""
---------------------------------------
I tested, and this fixes the problem.
Is this the appropriate solution?
That's the workaround I use, too. IMHO wpa_supplicant(8) should be
moved to /sbin.

Holger
Loading...