LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 06-17-2013, 12:21 PM   #1
MultiSith
LQ Newbie
 
Registered: Mar 2013
Posts: 19

Rep: Reputation: Disabled
Connectivity fails (with WN111v2) during high traffic


I'm trying to make-do with a Netgear (WN111v2) USB wifi card ...and I'm frustrated. The connection seems to work out-of-the-box with the carl9170 module. Low-bandwidth internet access seems fine and can endure for semi-long periods of time. But, during periods of high through-put, connectivity eventually ceases. The interface remains up but I cannot ping the gateway interface. (Wireshark shows some LLC stuff. If anyone thinks that will be helpful, ask.)

My first solution included disconnecting/reconnecting the nic. In the past, I've also remedied the problem by creating a cron job to unload/reload the module forcing the connection to reset. The best solution I found was a 50-ft ethernet cable--but wifi-alternatives are longer an option. So, I'm looking for a fix or help with my work-around script.

The best solution would prevent the lapse in connectivity. I haven't researched about this in several months but I believe it boils down to firmware/module issues--something I'm not really too comfortable addressing in detail. If you're familiar with the problem and know of a permanent solution, I'd be happy to implement it. But I am hesitant to experiment with it when I KNOW work arounds will suffice.

My plan-b solution is to create a script (to be run via cron, unless someone has a better idea) to check connectivity and reset the connection (original credit goes to some thread I found weeks ago, but I've been tweaking...):
Code:
# restart wifi if lacking connectivity
dest=192.168.0.1
limit=50
loss=100

loss=$(ping -c 3 -i 3 -W 15 $dest | grep -o "[0-9]*%" | tr -d %) > /dev/null 2>&1
if [ "$loss" -gt "$limit" ]; then
        logger "pinger: packet loss ($loss%) exceeded $limit, restarting network-manager ..."
	service network-manager restart
fi
...which causes cron to mail me...
Code:
/usr/bin/service: 127: /usr/bin/service: stop: not found
/usr/bin/service: 128: exec: start: not found
I thought maybe "service" might be having permission issues, so I did 'chown root:root' and 'chmod +s' to the script. (I also tried "sudo service network-manager restart" in the script but both got me a long block of something like this:
Code:
stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.138" (uid=1001 pid=15151 comm="stop network-manager ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.139" (uid=1001 pid=15148 comm="start network-manager ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
...which, I think, is the same thing I get by executing "service network-manager restart" (as a user). FYI, "sudo service network-manager restart" does the trick--if only I could automate this!

I know I'm close! Can anyone offer some suggestions?

Advice and URLs on permissions in the context of cron would be welcome. I'm not sure I understand that thoroughly and most of the stuff I've found has to do with either cron or permissions; it doesn't seem complicated but maybe I'm missing something.

(I don't know that a hammer is the right tool for this job but its sounding like a better and better plan.)

Last edited by MultiSith; 06-17-2013 at 02:48 PM.
 
Old 06-19-2013, 02:52 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,033

Rep: Reputation: 75
The working directory could be different when cron tool launch the script. Maybe you should change current directory when you run service.
 
Old 06-20-2013, 12:55 AM   #3
MultiSith
LQ Newbie
 
Registered: Mar 2013
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by nini09 View Post
change current directory when you run service
Thanks for the suggestion! I added "cd /path/to/script" but I'm still having trouble.
I thought it worked but my authentication from sudo was still a factor when I tested. I am receiving
Code:
sudo: no tty present and no askpass program specified
from cron via mail.

So, I tried removing "sudo" from "service network-manager restart" but, in that case, I still get:
Code:
stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.49" (uid=1001 pid=11812 comm="stop network-manager ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.50" (uid=1001 pid=11809 comm="start network-manager ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
The script belongs to root and the permissions are: rwxrwxrwt. It works if I run the script with sudo ...so why not as cron with sticky bit? Is there another way to restart the wireless that might be more effective?

Last edited by MultiSith; 06-20-2013 at 02:33 AM.
 
Old 06-20-2013, 01:01 PM   #4
MultiSith
LQ Newbie
 
Registered: Mar 2013
Posts: 19

Original Poster
Rep: Reputation: Disabled
Alright, my script solution is implemented. I ended up putting /usr/sbin/service into /etc/sudoers for my account and reseting the file permissions to mine (751). HERE is a link for more information about running a script as root. I'm open to alternatives if anyone can suggest a better way.

Meanwhile, I have an every-two-minute cron job for a script to ping and possibly restart network manager. Its a solution but the key issue is losing connectivity to begin-with. I'll keep the thread open in the interest of an actual solution. (And, call me picky, but... I would prefer not to make the hdd's arm dance every 120-seconds for the rest of its understandably-short life. This is an old desktop, not a production server. Poor thing deserves to sleep if it can. )

I'm not sure if it is related to the lapse in connectivity but I do occasionally see this in my syslog:
Code:
ieee80211 phy0: invalid plcp cck rate (0).
I wonder if this is the reason for the disconnection or indicative of self-correction...? Otherwise, I haven't noticed anything I don't understand to be normal. Is there another log file I could be monitoring?
 
Old 06-20-2013, 02:40 PM   #5
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,033

Rep: Reputation: 75
For CRON issue, they have configuration file. You should check these files and content, such as environment macro, like PATH. The following link may help you.
http://www.cyberciti.biz/faq/how-do-...-or-unix-oses/

For root cause, WiFi driver issue, you can check patch or new version. The message you got should be from WiFi driver. It tell you driver got trouble. Some driver can recover itself and some need reset.
 
Old 06-21-2013, 12:09 AM   #6
MultiSith
LQ Newbie
 
Registered: Mar 2013
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by nini09 View Post
Sweet, very good link. Thank you!

I currently have the script working */2 * * * * with crontab (as user via sudoers) but I had also tried using /etc/crontab, thinking it would execute as root. I believe that's where I got confused. In any case, it seems to be working now. I'm looking into driver version to see if I have the latest...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apache high cpu load on high traffic awww Linux - Newbie 9 10-04-2011 02:22 PM
[SOLVED] Connectivity test fails OptusWrlssBrdbnd, configuration ok widda Mandriva 15 01-21-2010 05:32 AM
Network outage at high traffic eitcheitch Linux - Networking 2 05-21-2009 04:31 AM
GFS in High Traffic paulberry Linux - Server 1 05-21-2008 08:38 AM
Network Traffic Stops After High Traffic windisch Linux - Networking 6 12-17-2007 05:45 PM


All times are GMT -5. The time now is 07:04 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration