diff options
author | Bill Nottingham <notting@redhat.com> | 2012-03-09 11:18:10 -0500 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2012-03-09 11:18:10 -0500 |
commit | 60b84547c03ec7d82633f3c9d6939af4747a6bff (patch) | |
tree | 07c354e96bfc9586b66183c1f9693c5161323867 | |
parent | 2858dfa0b9b2c56dad8d46d5ff9aabe05a67c870 (diff) | |
download | initscripts-60b84547c03ec7d82633f3c9d6939af4747a6bff.tar initscripts-60b84547c03ec7d82633f3c9d6939af4747a6bff.tar.gz initscripts-60b84547c03ec7d82633f3c9d6939af4747a6bff.tar.bz2 initscripts-60b84547c03ec7d82633f3c9d6939af4747a6bff.tar.xz initscripts-60b84547c03ec7d82633f3c9d6939af4747a6bff.zip |
Use NetworkManager-compatible lease file names by default.
-rwxr-xr-x | sysconfig/network-scripts/ifdown-eth | 3 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 6 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions | 9 |
3 files changed, 15 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth index fcbae80e..e120af76 100755 --- a/sysconfig/network-scripts/ifdown-eth +++ b/sysconfig/network-scripts/ifdown-eth @@ -86,8 +86,9 @@ retcode=0 for VER in "" 6 ; do if [ -f "/var/run/dhclient$VER-${DEVICE}.pid" ]; then dhcpid=$(cat /var/run/dhclient$VER-${DEVICE}.pid) + generate_lease_file_name $VER if [[ "$DHCPRELEASE" = [yY1]* ]]; then - /sbin/dhclient -r -lf /var/lib/dhclient/dhclient$VER-${DEVICE}.leases -pf /var/run/dhclient$VER-${DEVICE}.pid ${DEVICE} >/dev/null 2>&1 + /sbin/dhclient -r -lf ${LEASEFILE} -pf /var/run/dhclient$VER-${DEVICE}.pid ${DEVICE} >/dev/null 2>&1 retcode=$? else kill $dhcpid >/dev/null 2>&1 diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index 335394f8..9d926f23 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -192,7 +192,8 @@ if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then else DHCLIENTCONF=''; fi; - DHCLIENTARGS="${DHCLIENTARGS} -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${ONESHOT} -q ${DHCLIENTCONF} -lf /var/lib/dhclient/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${DEVICE}.pid" + generate_lease_file_name + DHCLIENTARGS="${DHCLIENTARGS} -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${ONESHOT} -q ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient-${DEVICE}.pid" echo echo -n $"Determining IP information for ${DEVICE}..." if [[ "${PERSISTENT_DHCLIENT}" != [yY1]* ]] && check_link_down ${DEVICE}; then @@ -299,7 +300,8 @@ fi # IPv6 initialisation? /etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG} if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then - /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} -lf /var/lib/dhclient/dhclient6-${DEVICE}.leases -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} + generate_lease_file_name 6 + /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} fi if [ "${IPX}" = yes ]; then diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index f6d2f05b..6402a7dc 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -59,6 +59,15 @@ get_uuid_by_config () dbus-send --system --print-reply --dest=com.redhat.ifcfgrh1 /com/redhat/ifcfgrh1 com.redhat.ifcfgrh1.GetIfcfgDetails string:"/etc/sysconfig/network-scripts/$1" 2>/dev/null | awk -F '"' '/string / { print $2 }' } +generate_lease_file_name () { + local ver=$1 + LEASEFILE="/var/lib/dhclient/dhclient$ver-${DEVICE}.leases" + if [ -f $LEASEFILE ]; then + return + fi + LEASEFILE="/var/lib/dhclient/dhclient$ver-${UUID}-${DEVICE}.lease" +} + need_config () { local nconfig |