You are not logged in.

#26 2008-08-22 11:40:16

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.1.0 release candidate 1

stefan1975 wrote:

well it seems to be mainly my own fault. I copied a profile from the examples folder and customized it to my needs. What i now discovered that I missed a predefined entry in the example:

POST_DOWN="some command"

leaving that to the set default will cause this error. maybe it should be empty or commented out by default? or maybe I just should have looked better myself.

Yeah.. it's just an example. I'll edit the example so it won't error out.

as to the functional stuff, i am not looking for high tech functionality. I was more or less thinking in the line of streamlining the scripting. I do not have a definitive technical idea as to how i would solve it myself, and adding dependencies to the scripts is not a great idea either but in general something like this:

I know it's not high tech, but you can understand that i'm hesitant to add "intelligence" to netcfg, otherwise everyone will expect intelligence from it.

> sudo mii-tool
eth0: no link

if that returns "no link", then do not bring up the interface and skip to the next one in the array. if it does have link bring it up if it is first in the array and end the routine. from the top of my head of course.

ethernet profiles already do this. It just doesnt to the end after finding a successful profile. It's a pretty trivial change for that, so i'll add it.

Cheers
James

Offline

#27 2008-08-24 17:22:50

smartcat99s
Member
Registered: 2006-03-17
Posts: 44

Re: netcfg v2.1.0 release candidate 1

For some reason, the ethernet link detection doesn't work on my machine during boot.  It works after boot though. (r8169)


Running Folding@Home for Team 11108 - My Stats

Offline

#28 2008-08-26 11:09:08

Aitch
Member
From: Norway
Registered: 2008-02-19
Posts: 43

Re: netcfg v2.1.0 release candidate 1

OK here are the eagerly awaited results of my extensive testing program big_smile

While most profile options don't give t### whether their values are quoted or not I have found two that are sensitive to this (at least on my set up).

As stated above SCAN fails if I include the quotes and interestingly the profile will fail to associate if IP is given without quotes!  I'm not sure where I should be looking to find out why??

Offline

#29 2008-08-26 11:41:58

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.1.0 release candidate 1

smartcat99s: I've seen similar behaviour on one of my computers, I'll look into it. Might be worth opening a bug for.

Aitch: I'll do some testing, though what you report still doesn't make sense.

$ SCAN=yes echo $SCAN
yes
$ SCAN="yes" echo $SCAN
yes

Bash doesnt differentiate between quotes and no quotes. I did copy checkyesno from FreeBSD, so maybe there's something wierd in that I have missed....

Sorry, time's short at the moment - I'll investigate some of this on midsemester break. Too many assignments at the moment.

Offline

#30 2008-08-26 13:27:58

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: netcfg v2.1.0 release candidate 1

iphitus, you're right of course that bash doesn't care about the quotes in such cases. But those lines wouldn't prove it, right? Bash will expand the variables on a command line before executing anything. So:
$ SCAN=garbage
$ SCAN=yes echo $SCAN
should return "garbage" (regardless of whether it's echo $SCAN or echo "$SCAN").

Your intended point is correct, though. It doesn't matter whether you use:
SCAN=garbage
or:
SCAN="garbage"
Since there's nothing that needs escaping in "garbage", or "YES", those are equivalent.

Offline

#31 2008-08-26 13:31:45

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: netcfg v2.1.0 release candidate 1

Aitch, can you carefully count the quotes in the profiles that seem to be requiring them? Are they matched up? Are you sure those profiles aren't missing a close quote/don't have an extra open quote on a previous line?

Although I can't imagine how they could end up working at all in those cases.

Offline

#32 2008-08-26 20:07:13

Aitch
Member
From: Norway
Registered: 2008-02-19
Posts: 43

Re: netcfg v2.1.0 release candidate 1

Profjim, I've double, triple checked all that.  I have even messed them up to see what happened - each time I get a very full description of the errors with line numbers and all.  The quotes issue gives no such messages, just the final wireless association failed.

If you can give me some hint on how to get more info about what is happening during the failed netcfg attempts I would appreciate it.

I have LOCALE="en_GB.utf8" and KEYMAP="no.latin1" in rc.conf which may or may not be relevant.

Offline

#33 2008-08-26 20:55:25

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: netcfg v2.1.0 release candidate 1

Like iphitus, I can't imagine how it's possible for the difference in quotes to matter. These profile files are just getting sourced anyway. But in a spirit of inquiry:
1. Is your shell bash?
2. Try adding this to the very end of the problematic profiles:
     echo "Scan value=<$SCAN>"
Then try running netcfg2 this_profile. Do it once with and once without quotes. Do you not see exactly the following output:
    Scan value=<YES>
both times?

Offline

#34 2008-08-26 21:04:43

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: netcfg v2.1.0 release candidate 1

If you know how to shell script, the /usr/lib/network/network.subr and /usr/lib/network/wireless.subr files aren't terribly complex. You'll have to read a while to get your bearings. But it's very doable. If you can get to an overall understanding of what's going on, then you can start sticking some:
    echo "DEBUG: point1"
and so on in those files and try to connect. That'll clue you into where the script is failing. Probably profile_up() in network.subr is successfully loading your profile and getting to the point of calling wireless_up() from wireless.subr, and probably that's getting to a code block that does "checkyesno" against $SCAN (checkyesno is a helper function in network.subr), and if that returns 0 (i.e. true, i.e. if $SCAN is a yes-like value) wireless_up will call find_essid $INTERFACE "$ESSID" (check that ESSID has quotes around it) to see if your network is present. You can start throwing echo DEBUGs in around that point.

Also in the find_essid function.

When you're done testing, just re-install the netcfg package and your echo DEBUGs will get overwritten with clean files.

Offline

#35 2008-08-26 21:09:34

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: netcfg v2.1.0 release candidate 1

Another point, in case you're NOT that experienced a shell scripter: the lines in your profile that say:
   variable=VALUE
or
   variable="VALUE"
can't have any space before or after the = sign.

Offline

#36 2008-08-27 05:37:39

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.1.0 release candidate 1

Documentation updated, netcfg 2.1 will be released tonight

Offline

#37 2008-08-27 21:20:38

Aitch
Member
From: Norway
Registered: 2008-02-19
Posts: 43

Re: netcfg v2.1.0 release candidate 1

Thanks for the tips Profjim, here's an update:

I am using GNU bash, version 3.2.39(1)

There are no spaces around the = signs.

I tried echoing "Scan value=<$SCAN>" and got the same output irrespective of quotes or not.

BUT - all that upping and downing of profiles showed that both the profile set-ups I had problems with would eventually load if tried several times in succession.  This is an issue I had read about on the forums, but hadn't followed up as it didn't seem to apply to the issue I had found. I'll go do some more digging now based on your tips.  Thanks again.

Offline

#38 2008-08-28 12:45:16

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.1.0 release candidate 1

adamtulinius wrote:

netcfg2+wpa doesn't work if the key contains $. it needs to be escaped in the profile, which suck, since the application itself should do that.

Yeah I know. I'll get to that in a moment...

oh, and the code for checking whether a wireless network is in range or not seems stupid (i'm not an bash-expert).
Why not make it scan *once*, save that result, and *then* determine which ssid to connect to, instead of doing the scan-thingy one profile at a time (sorry if i got that wrong).

Have a look at auto-wireless, it does what you want.

Generally it seems like netcfg2 contains lots of hacks that could have been avoided with using python (or similar) instead tongue

Now, yes, but at the time I started working on netcfg (at least 2 years ago), bash was the best route. I had limited time and needed something:
- Easy and quick to work with
- Familiar
- Widest driver compatibility
- Something that worked for me personally

Go back two years ago...
- Using wpa_supplicant only for wireless wasnt an option as driver support sucked.
- I didn't want to use C, nor did I have sufficient experience with C
- I think that running and parsing iwconfig/ifconfig via python is pretty yucky.
- It had to be simple to be accepted as "Arch Like" and not automagic fancy complicated. What nobody/few ever saw was the precursors to netcfg, which were pretty ugly/complicated (including a python one).

Now... wpa_supplicant is supported by most drivers, and it's got a kickass dbus interface. I've got some prototype code that uses that dbus interface via python, and you can expect to see some of it in 2.2.

James

Last edited by iphitus (2008-08-28 12:50:23)

Offline

#39 2008-08-28 13:27:57

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: netcfg v2.1.0 release candidate 1

i love netcfg

Offline

#40 2008-10-10 06:47:25

blixawillbargeld
Member
Registered: 2008-01-22
Posts: 35

Re: netcfg v2.1.0 release candidate 1

i just wanted to confirm aitchs behavior! same for me...doesnt work with scan="no" but works with scan=no....dont ask me why :-)

its an atheros AR5212/AR5213 card (thats what lspci shows)...

cheers
stefan

Offline

#41 2008-12-08 22:02:15

tsenart
Member
Registered: 2008-02-14
Posts: 9

Re: netcfg v2.1.0 release candidate 1

Hey people.

I've read all the stuff regarding my problem here in the forum but I can't find a solution.
I have iwl4965 and I just can't understand how to get my wireless to work (either with netcfg2+wpa or without it).
Sometimes it says:
:: wireless up    [BUSY]  - Network unavailable   [FAIL]
Others when I have scan="no":
:: wireless up    [BUSY]  - Association failed    [FAIL]
And it also says when I try iwlist wlan0 scan that my interface doesn't support scanning!

Here's my /etc/network.d/wireless

CONNECTION="wireless"
DESCRIPTION="Wireless access"
INTERFACE=wlan0
SCAN="yes"
SECURITY="wpa"
ESSID="PT-WIRE-063"
KEY="xxxxxxx" #all lowercase normal characters
IP="dhcp"
TIMEOUT=30
QUIRKS=(preesssid)

Could anyone help me please?
Thanks

Offline

#42 2008-12-09 18:08:35

buddabrod
Member
From: Germany
Registered: 2007-02-25
Posts: 220

Re: netcfg v2.1.0 release candidate 1

Is the interface up before you try to scan manually?

Your quirk should be preessid, try also with both prescan and preessid.

Offline

Board footer

Powered by FluxBB