You are not logged in.

#1 2012-08-23 03:48:00

Registered: 2010-04-17
Posts: 68

[SOLVED] Automatically execute a command before running netcfg?

I have a Broadcom wireless card that I can not get to connect realiably using netcfg unless I run the following command beforehand:

# ip link set wlan0 up

Is there a simple way to automate this so "ip link set wlan0 up" is automatically run before netcfg my_wireless_profile runs?

I did notice in the wiki page on netcfg there is a PRE_UP varialble, but it's unclear what file this is added to. I tried it in /etc/network.d/interface/wlan0 with the following content:
PRE_UP="ip link set wlan0 up"

...but this only results in a unreliable connection that usually fails.

Last edited by marko2010 (2012-08-23 07:00:59)


#2 2012-08-23 03:54:19

Inspector Parrot
Registered: 2011-11-29
Posts: 19,951

Re: [SOLVED] Automatically execute a command before running netcfg?

I have never used netcfg, so take this with a large grain of salt, but wouldn't that go in the profile(s)?

On a different note, though, netcfg is definitely supposed to bring up the interface itself - that's what PRE_UP and POST_UP are in reference to.  If is not doing that there is something wrong - have you tried to solve the underlying problem yet?

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman


#3 2012-08-23 07:00:05

Registered: 2010-04-17
Posts: 68

Re: [SOLVED] Automatically execute a command before running netcfg?

I noticed "DEBUG: wpa_cli -i wlan0 -p /run/wpa_supplicant status" appearing over and over in the debug output, so a duckduckgo search lead me to this post: … in-ubuntu/

Although the post deals with Ubuntu, but he says:

"wpa_cli expects to talk to wpa_supplicant over a control socket, but the default wpa_supplicant command line options don’t create a control socket (only the D-Bus interface is activated)."

So after making the edit to /usr/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service he recommended and killing wpa_supplicant (which appeared to immediatly restart) netcfg began working like it is supposed to. smile There was no need for me to run a command before running netcfg.

I'm not sure why I seem to be the only one on Arch who had this problem, I am running a pretty minimal system --  but at least it is solved until the change is overwritten by an update.


Board footer

Powered by FluxBB