Bug 5460 - ifdown dosen't hangup when ifup is called twice or more times for a ppp device
ifdown dosen't hangup when ifup is called twice or more times for a ppp device
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Michael K. Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-09-30 20:40 EDT by bogado
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-10-07 16:04:23 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 bogado 1999-09-30 20:40:12 EDT
When ifup is called twice the second ifup-ppp overwrites
the pid file for pppd with a bogus pid of a pppd that will
die in seconds due to the modem device being locked by the
first pppd.

	The following diff fixes the problem, it is prepared from
the ifup-ppp included in the initscripts-4.16-1. I basicly
creates yet another lock file ifup-$DEVICE in the /var/run
dir. The ifup-ppp checks if this file exists before doing
anything.

	It also uses this files to hold 'REPORT' lines from the
chat scripts (I don't know if I missed something here but
there is no way of doing this directly from the
ifcfg-$DEVICE file does it?)

19a20,28
> if [ -f /var/run/ifup-$DEVICE ] ; then
>   # I'm already connected or trying to connect
>   logger -p daemon.info -t ifup-ppp \
>     "Already connected or trying to connect to $DEVICE"
>   exit 1
> fi
>
> echo > /var/run/ifup-$DEVICE
>
91c100
<     connect "/usr/sbin/chat $chatdbg -f $CHATSCRIPT"
---
>     connect "/usr/sbin/chat -r /var/run/ifup-$DEVICE
$chatdbg -f $CHATSCRIPT"
120a130
>     rm -f /var/run/ifup-$DEVICE
Comment 1 Michael K. Johnson 1999-10-07 16:04:59 EDT
ifup-ppp and ifdown-ppp are fragile in other ways as well in that
version of initscripts.  For Red Hat Linux 6.1, I rearchitected
PPP session management using a "ppp-watch" daemon, which has made
if{up,down}-ppp absolutely reliable in my torture tests.

I do not know if you can upgrade initscripts without upgrading
many other packages as well, but you can try (just keep your
old packages around to revert to in case of trouble...)

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