This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 144294 - ppp initscripts broken locks
ppp initscripts broken locks
Status: CLOSED CANTFIX
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks: FC5Target
  Show dependency treegraph
 
Reported: 2005-01-05 13:21 EST by Need Real Name
Modified: 2014-03-16 22:51 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-18 15:22:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2005-01-05 13:21:36 EST
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 13:27:49 EST
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 18:45:19 EST
ifdown on a ppp connection always fails to take the link down for me.
Comment 3 Need Real Name 2005-01-17 22:23:23 EST
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 18:16:41 EDT
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 15:22:50 EDT
Closing per prior comment.

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