Red Hat Bugzilla – Bug 58893
pppd doesn't quit if Ctrl+C entered while executing connect script
Last modified: 2007-04-18 12:39:13 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20011226
Description of problem:
I found this problem while setting up ppp and wvdial on a new RedHat 7.2 box
(previously I'd used my own scripts to dial and connect).
If the user sends a SIGINT or a SIGTERM to pppd while it is executing the
connect script (by Ctrl+C for instance), pppd first responds with "Terminating
on signal 2", then it kills the connect script. However, rather than quitting at
this point it continues on and tries to establish the PPP connection. From the
syslog I see that it reports "Serial connection established", "Using interface
Further SIGINTs result in "Terminating on signal 2" messages, but it still
doesn't quit. Sending SIGQUIT (via Ctrl+\), however, works correctly -- pppd
says "Fatal signal 3" and exits.
This bug is most noticable if wvdial is used as the connect script, since wvdial
returns a zero exit code if it is killed with SIGINT even in its "chat mode"
(could this could be a bug too?).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. /usr/sbin/pppd -detach /dev/ttyS1 115200 noauth connect "/usr/bin/wvdial
--remotename ppp0 --chat MyWvDialSection"
(this is basically what /etc/sysconfig/network-scripts/ifup-ppp ends up doing)
2. Wait for wvDial to start dialling
3. Press Ctrl+C before wvDial exits
pppd says "Terminating on signal 2", it kills wvdial, and then pppd says:
Serial connection established.
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS1
pppd does not quit, even when sent more SIGINTs or SIGTERMs.
pppd should say "Terminating on signal 2", then kill wvdial, then exit.
I'll attach a patch to ppp-2.4.1-2 that fixes this bug.
This bug is not apparent through rp3, since if the user cancels rp3 while it is
running /sbin/ifup, rp3 doesn't try to kill ifup. Instead it simply runs
/sbin/ifdown (or more correctly, /etc/sysconfig/network-scripts/ifdown-ppp)
tries to kill ppp-watch with a SIGTERM, then a few seconds later it kills
ppp-watch with another SIGTERM. ppp-watch, upon receiving the second SIGTERM,
kills its process group with SIGKILL. So in the end the connection DOES get
cancelled, just not in the quickest way :-)
Created attachment 43634 [details]
Quit if we receive a SIGINT or SIGTERM while running script
Please verify this with a newer version of Red Hat Enterprise Linux or Fedora
Core and reopen it against the new version if it still occurs.
Closing as "not a bug" for now.