Bug 144294

Summary: ppp initscripts broken locks
Product: [Fedora] Fedora Reporter: Need Real Name <mal>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED CANTFIX QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: denis, mattdm, rvokal, suckfish, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-18 19:22:50 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:
Bug Depends On:    
Bug Blocks: 150221    

Description Need Real Name 2005-01-05 18:21:36 UTC
There is a long standing race in initscripts when starting/stopping
dialup ppp.
Sometimes there is an orphan pppd running that there is no way to kill
 by using ifdown. The only way that works is killall pppd.
Also ifup same connection gets started, but fails.


This is an extermelly annooying bug, because people who can not
killall pppd
have to reboot the computer. 

To reproduce:
do (one or several times)
ifup pppconnection 
then, while connection is not established yet do 
ifdown pppconnection

eventially you would get to a state that there is an orphan pppd
running, which can not be killed by ifdown.

This bug can be fixed either by fixing
/etc/sysconfig/network-scripts/ifup-ppp
/etc/sysconfig/network-scripts/ifdown-ppp

or by chaning ppp-watch logic.

A kludge (not fixing all the race, but at least making 
ifdown pppconnection
taking down the link)
is to modify /etc/sysconfig/network-scripts/ifdown-ppp
is below (not meant to be applied, just give you an idea)
is attached below.
The case seems to to be covered (and why killall is needed) is 
when pppd is started, but link is not established yet.
Thus the file /var/run/ppp-${CONFIG}.pid does not exists.
I think pppd should be modified to create
/var/run/ppp-${CONFIG}.pid
file when pppd is started (even when the connection is not established)
and create /var/run/ppp-ppp[1234].pid when the connection gets established

In the end of the report I would like to state that 
it would be good to review all the locking ppp rules,
and not to disgrace linux by broken ppp.


 diff -u /etc/sysconfig/network-scripts/ifdown-ppp ifdown-ppp
--- /etc/sysconfig/network-scripts/ifdown-ppp   2003-09-15
01:40:21.000000000 -0400
+++ ifdown-ppp  2005-01-05 13:04:51.023287296 -0500
@@ -29,6 +29,17 @@

file=/var/run/pppwatch-${DEVICE}.pid

 if [ ! -f $file ]; then
     # ppp isn't running, or we didn't start it
+if [ -f /var/run/ppp-${CONFIG}.pid ] ; then
+    PID=`head -1 /var/run/ppp-${CONFIG}.pid`
+    kill -TERM ${PID}
+    sleep 2
+    [ ! -d /proc/${PID} ] && exit 0
+    sleep 5
+    [ ! -d /proc/${PID} ] && exit 0
+    kill -TERM ${PID}
+    [ ! -d /proc/${PID} ] && exit 0
+fi
+    killall pppd
     exit 0
 fi

Comment 1 Need Real Name 2005-01-05 18:27:49 UTC
The phrase above 
>The case seems to to be covered (and why killall is needed) is 
to be meant

The case seems not to be covered by the patch (and this is why killall
is still needed) is 

Comment 2 Ralph Loader 2005-01-17 23:45:19 UTC
ifdown on a ppp connection always fails to take the link down for me.

Comment 3 Need Real Name 2005-01-18 03:23:23 UTC
For me ppp mostly works, but fails in the following situations:
1. start several ifup and several ifdown. You definitelly get a race.

2. ppp failed once (bacuse connection lost or other)
then ifdown in some situation does not work.

the patch above also does not fix all situations, ifdown still
sometimes fails

This kludge to ifdown-ppp works better

for s in 15 15 9 ; do
killall -$s ppp-watch
sleep 1
killall -$s pppd
sleep 1
done



Comment 4 Matthew Miller 2006-07-10 22:16:41 UTC
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!


Comment 5 Bill Nottingham 2007-09-18 19:22:50 UTC
Closing per prior comment.