You are not logged in.

#1 2012-12-29 20:36:56

HMW
Member
Registered: 2010-11-21
Posts: 12

[SOLVED] wifi-menu confusion

Hi!

I have a question regarding the behaviour of wifi-menu. It works, but rather strange. Here's what I find odd:
If I try to run the command using sudo, this happens

[magnus@arch ~]$ sudo wifi-menu
:: Scanning for networks                                               [ BUSY ] 
/usr/lib/network/8021x: rad 63: wpa_supplicant: kommandot finns inte
/usr/lib/network/8021x: rad 21: wpa_cli: kommandot finns inte
/usr/lib/network/8021x: rad 21: wpa_cli: kommandot finns inte
/usr/lib/network/8021x: rad 21: wpa_cli: kommandot finns inte
/usr/lib/network/8021x: rad 21: wpa_cli: kommandot finns inte
                                                                       [FAILED]

(Pardon the Swedish output, but you get the drift: kommandot finns inte == command not found)

Ok... if I then swith to root (using su and the root password), I get the exact same messages complaining about wpa_supplicant and wpa_cli.
One would assume about now that this is broken somehow. BUT! If I do:

sudo -i

followed by my password, and then enter

wifi-menu

IT WORKS! In other words; I can now browse the available networks and select the one I want.

If someone could shed some light over this I would appreciate it. Now that I have found this out, I can use wifi-menu, but I find it more than just a little odd!

Thanks for reading,
HMW

Last edited by HMW (2012-12-30 14:26:28)

Offline

#2 2012-12-30 03:04:35

metgz
Member
From: United States
Registered: 2012-11-13
Posts: 21

Re: [SOLVED] wifi-menu confusion

That is extremely odd. The only explanation I can think of is, it has something to do with where the wpa_supplicant executable file is located. For instance, root won't find things in your ~user/bin/ directory.

What is the output of this:

% which wpa_supplicant
% which wpa_cli

This:

% su
# which wpa_supplicant
# which wpa_cli

This:

% sudo which wpa_supplicant
% sudo which wpa_cli

And, finally, this:

% sudo -i
# which wpa_supplicant
# which wpa_cli

Offline

#3 2012-12-30 14:01:46

HMW
Member
Registered: 2010-11-21
Posts: 12

Re: [SOLVED] wifi-menu confusion

metgz wrote:

That is extremely odd.

Indeed! But maybe you are on to something. I'll give your suggestions a go:

1. No sudo:

$ which wpa_supplicant
which: no wpa_supplicant in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:
/usr/sbin:/sbin:/home/magnus/bin)

$ which wpa_cli
which: no wpa_cli in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:
/usr/sbin:/sbin:/home/magnus/bin)

2. su:

# which wpa_supplicant
which: no wpa_supplicant in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:
/usr/sbin:/sbin:/home/magnus/bin)

# which wpa_cli
which: no wpa_cli in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:
/usr/sbin:/sbin:/home/magnus/bin)

3. sudo -i:

# which wpa_supplicant
/usr/sbin/wpa_supplicant

# which wpa_cli
/usr/sbin/wpa_cli

Ok. It seems as though you are right. But I still don't get it! In example number 3, both wpa_supplicant and wpa_cli are found in /usr/sbin - so they are there, but why only when I use sudo -i???

Thanks for your input metgz, I appreciate it, but am still very confused...

Offline

#4 2012-12-30 14:25:54

HMW
Member
Registered: 2010-11-21
Posts: 12

Re: [SOLVED] wifi-menu confusion

Mystery is solved!

Apparently, there was a space (" ") in my $PATH, like so:

/usr/local/bin:/usr/bin:/bin:/usr/local/sbin: /usr/sbin:/sbin:/home/magnus/bin

How did it get there? I have no clue. Once my $PATH was correct wifi-menu works as expected; I can now use it with regular sudo.

Mucho kudos to metgz again, without your input I wouldn't have solved this, thanks!

Offline

#5 2012-12-30 20:20:29

metgz
Member
From: United States
Registered: 2012-11-13
Posts: 21

Re: [SOLVED] wifi-menu confusion

Glad I could be of help.

Offline

Board footer

Powered by FluxBB