aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initscripts.spec5
-rwxr-xr-xsysconfig/network-scripts/ifdown-ppp25
-rwxr-xr-xsysconfig/network-scripts/ifup-ppp12
3 files changed, 29 insertions, 13 deletions
diff --git a/initscripts.spec b/initscripts.spec
index b9335003..d6350b05 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -1,6 +1,6 @@
Summary: The inittab file and the /etc/init.d scripts.
Name: initscripts
-Version: 5.39
+Version: 5.40
Copyright: GPL
Group: System Environment/Base
Release: 1
@@ -232,6 +232,9 @@ rm -rf $RPM_BUILD_ROOT
%ghost %attr(0664,root,utmp) /var/run/utmp
%changelog
+* Mon Aug 7 2000 Nalin Dahyabhai <nalin@redhat.com>
+- fix demand-dialing support for PPP devices
+
* Sun Aug 6 2000 Bill Nottingham <notting@redhat.com>
- add RETRYCONNECT option for ifcfg-pppX files (kenn@linux.ie)
diff --git a/sysconfig/network-scripts/ifdown-ppp b/sysconfig/network-scripts/ifdown-ppp
index 3265c72d..282c22b0 100755
--- a/sysconfig/network-scripts/ifdown-ppp
+++ b/sysconfig/network-scripts/ifdown-ppp
@@ -7,7 +7,18 @@ cd /etc/sysconfig/network-scripts
CONFIG=$1
source_config
-file=/var/run/pppwatch-$DEVICE.pid
+if [ "${DEMAND}" != no -a -f /var/run/ppp-${DEVICE}.pid ] ; then
+ PID=`head -1 /var/run/ppp-${DEVICE}.pid`
+ kill -TERM ${PID}
+ sleep 2
+ [ ! -d /proc/${PID} ] && exit 0
+ kill -TERM ${PID}
+ sleep 2
+ [ ! -d /proc/${PID} ] && exit 0
+ exit 1
+fi
+
+file=/var/run/pppwatch-${DEVICE}.pid
if [ ! -f $file ]; then
# ppp isn't running, or we didn't start it
@@ -15,17 +26,17 @@ if [ ! -f $file ]; then
fi
PID=`cat $file`
-[ -n "$PID" ] || exit 1
+[ -n "${PID}" ] || exit 1
-kill -TERM $PID > /dev/null 2>&1
-[ ! -d /proc/$PID ] && exit 0
+kill -TERM ${PID} > /dev/null 2>&1
+[ ! -d /proc/${PID} ] && exit 0
sleep 2
-[ ! -d /proc/$PID ] && exit 0
+[ ! -d /proc/${PID} ] && exit 0
# killing ppp-watch twice in a row causes it to send a SIGKILL to pppd pgrp
-kill -TERM $PID > /dev/null 2>&1
+kill -TERM ${PID} > /dev/null 2>&1
# ip-down won't run in this case
/etc/sysconfig/network-scripts/ifdown-post $1
-[ ! -d /proc/$PID ] && exit 0
+[ ! -d /proc/${PID} ] && exit 0
exit 1
diff --git a/sysconfig/network-scripts/ifup-ppp b/sysconfig/network-scripts/ifup-ppp
index a8a3f7d6..d672f72e 100755
--- a/sysconfig/network-scripts/ifup-ppp
+++ b/sysconfig/network-scripts/ifup-ppp
@@ -6,7 +6,7 @@ cd /etc/sysconfig/network-scripts
# ifup-post for PPP is handled through /etc/ppp/ip-up
-if [ "$1" = daemon ] ; then
+if [ "${1}" = daemon ] ; then
# we've been called from ppp-watch, so don't invoke it for persistence
shift
else
@@ -21,8 +21,8 @@ else
fi
fi
-CONFIG=${1}
-[ -f "${CONFIG}" ] || CONFIG=ifcfg-$1
+CONFIG=$1
+[ -f "${CONFIG}" ] || CONFIG=ifcfg-${1}
source_config
if [ -z "${DISCONNECTTIMEOUT}" ]; then
@@ -92,6 +92,8 @@ if [ ${DEMAND} = yes ] ; then
else
opts="$opts demand idle 600"
fi
+else
+ opts="$opts updetach"
fi
if [ -z "${WVDIALSECT}" ] ; then
@@ -107,13 +109,13 @@ fi
"pppd started for ${DEVICE} on ${MODEMPORT} at ${LINESPEED}" &)&
if [ -n "${WVDIALSECT}" ] ; then
- exec /usr/sbin/pppd -detach $opts ${MODEMPORT} ${LINESPEED} \
+ exec /usr/sbin/pppd $opts ${MODEMPORT} ${LINESPEED} \
ipparam ${DEVICE} linkname ${DEVICE} \
noauth \
${PPPOPTIONS} \
connect "/usr/bin/wvdial --remotename ${DEVICE} --chat ${WVDIALSECT}"
else
- exec /usr/sbin/pppd -detach $opts ${MODEMPORT} ${LINESPEED} \
+ exec /usr/sbin/pppd $opts ${MODEMPORT} ${LINESPEED} \
ipparam ${DEVICE} linkname ${DEVICE} \
noauth \
${PPPOPTIONS} \