Bug 58893

Summary: pppd doesn't quit if Ctrl+C entered while executing connect script
Product: [Retired] Red Hat Linux Reporter: Michael Chapman <redhat-bugzilla>
Component: pppAssignee: Thomas Woerner <twoerner>
Status: CLOSED NOTABUG QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-13 09:19:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Quit if we receive a SIGINT or SIGTERM while running script none

Description Michael Chapman 2002-01-26 23:24:31 UTC
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
ppp0", etc.

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):
ppp-2.4.1-2

How reproducible:
Always

Steps to Reproduce:
As root:

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

Actual Results:

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.

Expected Results:

pppd should say "Terminating on signal 2", then kill wvdial, then exit.

Additional info:

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.

/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 :-)

Comment 1 Michael Chapman 2002-01-26 23:28:40 UTC
Created attachment 43634 [details]
Quit if we receive a SIGINT or SIGTERM while running script

Comment 2 Thomas Woerner 2004-08-13 09:19:25 UTC
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.