I'm using a 3G wireless (cellular) card for Internet access, connected using pppd, as fully documented on my blog. I originally had this setup under 8.04 (Hardy), followed by 8.10 (Intrepid) and now 9.04 (Jaunty).
Unfortunately, I'm having an issue where pppd is terminating rather than redialing when the connection is dropped. I had this happen intermittently on the previous OS releases, but now it is happening consistently and I cannot figure out why.
The high-level issue is that when the "Modem hangup" is detected, "persist" is enabled and pppd should redial. Instead, the "Modem hangup" is being followed by a "Terminating on signal 15" message, which causes pppd to exit and no redial is attempted.
System details:
Looking at the source code in /ppp-2.4.5git/pppd/main.c, the logic seems pretty simple. From handle_events:Code:$ uname -a Linux z-util 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux pppd version 2.4.5
Since asked_to_quit is never set, the main loop in the main method should pause for the holdoff (if set), then redial. However, it certainly seems that a separate SIGTERM / signal 15 is being received following the "hangup", which then causes the loop to break and pppd to exit.Code:... waiting = 0; calltimeout(); if (got_sighup) { info("Hangup (SIGHUP)"); kill_link = 1; got_sighup = 0; if (status != EXIT_HANGUP) status = EXIT_USER_REQUEST; } if (got_sigterm) { info("Terminating on signal %d", got_sigterm); kill_link = 1; asked_to_quit = 1; persist = 0; status = EXIT_USER_REQUEST; got_sigterm = 0; }
Here is a section of the PPP log from an actual modem session:
Where is this signal 15 (SIGTERM) coming from? Is there any method or tool to trace it? I don't see anywhere in the pppd source where it sends the signal to itself.Code:Script /etc/ppp/ip-up started (pid 6737) Script /etc/ppp/ip-up finished (pid 6737), status = 0x0 Hangup (SIGHUP) Modem hangup Connect time 16.4 minutes. Sent 71444 bytes, received 183221 bytes. Script /etc/ppp/ip-down started (pid 7049) Connection terminated. Script /etc/ppp/ip-down finished (pid 7049), status = 0x0 Terminating on signal 15
I normally have this connection configured as an "inet ppp" entry in /etc/network/interfaces. For the purposes of ruling some of that out, I ran pppd directly, using "pppd call Alltel debug nodetach persist" - and had the same issue where the "signal 15" is received and logged, and causes pppd to exit.
This is really getting to me, and I really wanted to try to find out what was causing this. To rule out my ISP, data card, and even USB (and a lot of udev), I setup pppd on another box running as a mock server, and connected the two through the RS232 serial ports and a null-modem adapter. I was able to reproduce the issue. By sending a SIGHUP to the "server" pppd, the "client" logs the hangup, as well as a "Terminating on signal 15" - just like the actual issue I'm having with the 3G data card. The only difference seems to be that the mock "server" using pppd seems a bit more courteous, and sends a reason of "User request" before disconnecting:
Going back to the actual modem, I can't think of a way to "force" it to hangup / disconnect to test the redial short of disconnecting it from the USB cable. This works, and does result in the same "Connection terminated.", "Modem hangup", and "Terminating on signal 15" messages. However, I don't want to do this too often at risk of damaging the device.Code:rcvd [LCP TermReq id=0x2 "User request"] LCP terminated by peer (User request) Connect time 1.6 minutes. Sent 19734 bytes, received 0 bytes. Script /etc/ppp/ip-down started (pid 24060) sent [LCP TermAck id=0x2] Script /etc/ppp/ip-down finished (pid 24060), status = 0x0 Connection terminated. Modem hangup Terminating on signal 15
I really need to find out where these 15 / SIGTERM signals are coming from. This is a clean install of Jaunty. I started removing / disabling all scripts in /etc/network/if-down.d, /etc/network/if-post-down.d, and /etc/ppp/ip-down.d, and wasn't able to resolve the issue.
My /etc/ppp/peers and /etc/chatscripts files are already documented on my blog (next post from previous), but included below for your convenience:
Code:/dev/ttyACM0 lock persist #debug hide-password noauth user ##########@alltel.net defaultroute #usepeerdns #Using bind9 instead. init "/usr/bin/logger -i /etc/ppp/peers/Alltel Calling..." connect "/usr/sbin/chat -Vf /etc/chatscripts/Alltel 2>/var/log/Alltel.log"Any help would be greatly appreciated. Please let me know if there are any additional logs I can provide or tests I can perform. Thanks!Code:ABORT 'BUSY' ABORT 'NO CARRIER' ABORT 'ERROR' '' 'AT' 'OK' 'ATQ0V1E0' 'OK' 'ATZ' 'OK' 'AT&F' 'OK' 'AT+CSQ' 'OK' 'ATDT#777' CONNECT CLIENT



Adv Reply



Bookmarks