Bug 144294 - ppp initscripts broken locks
Summary: ppp initscripts broken locks
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks: FC5Target
TreeView+ depends on / blocked
 
Reported: 2005-01-05 18:21 UTC by Need Real Name
Modified: 2014-03-17 02:51 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-09-18 19:22:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.