aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-eth
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-04-15 16:48:07 +0000
committerBill Nottingham <notting@redhat.com>2005-04-15 16:48:07 +0000
commitcda2a30cad994f3817513bf598ef2de16e4ebab5 (patch)
tree32e957071af27c330850f0a76915fb4a1908780c /sysconfig/network-scripts/ifup-eth
parent49660b9ccb2247f9d413927c4c72de3b74aa2baa (diff)
downloadinitscripts-cda2a30cad994f3817513bf598ef2de16e4ebab5.tar
initscripts-cda2a30cad994f3817513bf598ef2de16e4ebab5.tar.gz
initscripts-cda2a30cad994f3817513bf598ef2de16e4ebab5.tar.bz2
initscripts-cda2a30cad994f3817513bf598ef2de16e4ebab5.tar.xz
initscripts-cda2a30cad994f3817513bf598ef2de16e4ebab5.zip
check the pid file so we can print a sane error message (#143640)
Diffstat (limited to 'sysconfig/network-scripts/ifup-eth')
-rwxr-xr-xsysconfig/network-scripts/ifup-eth10
1 files changed, 9 insertions, 1 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index ea89e64d..b96a18b0 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -167,11 +167,19 @@ if [ -n "${DYNCONFIG}" -a -x /sbin/dhclient ]; then
exit 1
fi
+ # Check for a a running instance
+ if [ -f /var/run/dhclient-${DEVICE}.pid ]; then
+ dhcpid=`cat /var/run/dhclient-${DEVICE}.pid`
+ if [[ "`readlink /proc/$dhcpid/exe`" =~ "^/sbin/dhclient" ]]; then
+ echo $" failed - dhclient already running for interface ${DEVICE} ($dhcpid)."
+ exit 1
+ fi
+
if [ -n "$ETHTOOL_OPTS" ] ; then
/sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
fi
- if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
+ if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} >/dev/null 2>&1 ; then
echo $" done."
else
echo $" failed."