- Save conf files adding '.predhclient.$interface' to the name (#306381)
- Only restore conf files on EXPIRE/FAIL/RELEASE/STOP if there are no other dhclient processes running (#306381)
This commit is contained in:
parent
f586ac836e
commit
3aac9e5df0
@ -4,7 +4,7 @@
|
|||||||
Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent
|
Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent
|
||||||
Name: dhcp
|
Name: dhcp
|
||||||
Version: 4.0.0
|
Version: 4.0.0
|
||||||
Release: 9%{?dist}
|
Release: 10%{?dist}
|
||||||
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
|
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
|
||||||
# dcantrell maintaining the package) made incorrect use of the epoch and
|
# dcantrell maintaining the package) made incorrect use of the epoch and
|
||||||
# that's why it is at 12 now. It should have never been used, but it was.
|
# that's why it is at 12 now. It should have never been used, but it was.
|
||||||
@ -401,6 +401,11 @@ fi
|
|||||||
%{_libdir}/libdhcp4client.so
|
%{_libdir}/libdhcp4client.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Feb 07 2008 David Cantrell <dcantrell@redhat.com> - 12:4.0.0-10
|
||||||
|
- Save conf files adding '.predhclient.$interface' to the name (#306381)
|
||||||
|
- Only restore conf files on EXPIRE/FAIL/RELEASE/STOP if there are no other
|
||||||
|
dhclient processes running (#306381)
|
||||||
|
|
||||||
* Wed Feb 06 2008 David Cantrell <dcantrell@redhat.com> - 12:4.0.0-9
|
* Wed Feb 06 2008 David Cantrell <dcantrell@redhat.com> - 12:4.0.0-9
|
||||||
- Match LDAP server option values in stables.c and dhcpd.h (#431003)
|
- Match LDAP server option values in stables.c and dhcpd.h (#431003)
|
||||||
- Fix invalid sprintf() statement in server/ldap.c (#431003)
|
- Fix invalid sprintf() statement in server/ldap.c (#431003)
|
||||||
|
59
linux
59
linux
@ -25,9 +25,9 @@ PATH=/bin:/usr/bin
|
|||||||
|
|
||||||
function save_previous() {
|
function save_previous() {
|
||||||
if [ -e $1 ]; then
|
if [ -e $1 ]; then
|
||||||
mv $1 $1.predhclient
|
mv $1 $1.predhclient.$interface
|
||||||
else
|
else
|
||||||
echo ''> $1.predhclient
|
echo ''> $1.predhclient.$interface
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ make_resolv_conf() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ]; then
|
if [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ]; then
|
||||||
cp -fp /etc/resolv.conf /etc/resolv.conf.predhclient
|
cp -fp /etc/resolv.conf /etc/resolv.conf.predhclient.$interface
|
||||||
rscf=`mktemp /tmp/XXXXXX`;
|
rscf=`mktemp /tmp/XXXXXX`;
|
||||||
echo '; generated by /sbin/dhclient-script' > $rscf
|
echo '; generated by /sbin/dhclient-script' > $rscf
|
||||||
|
|
||||||
@ -385,7 +385,7 @@ function dhconfig() {
|
|||||||
|
|
||||||
tzfile=/usr/share/zoneinfo/Etc/GMT$(printf '%+d' $hoursWest)
|
tzfile=/usr/share/zoneinfo/Etc/GMT$(printf '%+d' $hoursWest)
|
||||||
if [ -e $tzfile ]; then
|
if [ -e $tzfile ]; then
|
||||||
/bin/mv -f /etc/localtime /etc/localtime.predhclient
|
/bin/mv -f /etc/localtime /etc/localtime.predhclient.$interface
|
||||||
/bin/cp -fp $tzfile /etc/localtime
|
/bin/cp -fp $tzfile /etc/localtime
|
||||||
/bin/touch /etc/localtime
|
/bin/touch /etc/localtime
|
||||||
fi
|
fi
|
||||||
@ -396,13 +396,13 @@ function dhconfig() {
|
|||||||
:
|
:
|
||||||
elif [ -n "$new_ntp_servers" ] && [ -e /etc/ntp.conf ]; then
|
elif [ -n "$new_ntp_servers" ] && [ -e /etc/ntp.conf ]; then
|
||||||
save_previous /etc/ntp.conf
|
save_previous /etc/ntp.conf
|
||||||
/bin/egrep -v '^server .* # added by /sbin/dhclient-script$'< /etc/ntp.conf.predhclient > /etc/ntp.conf
|
/bin/egrep -v '^server .* # added by /sbin/dhclient-script$'< /etc/ntp.conf.predhclient.$interface > /etc/ntp.conf
|
||||||
|
|
||||||
for s in $new_ntp_servers; do
|
for s in $new_ntp_servers; do
|
||||||
echo "server $s # added by /sbin/dhclient-script" >> /etc/ntp.conf
|
echo "server $s # added by /sbin/dhclient-script" >> /etc/ntp.conf
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -x /usr/bin/diff ] && /usr/bin/diff -q /etc/ntp.conf /etc/ntp.conf.predhclient >/dev/null 2>&1; then
|
if [ -x /usr/bin/diff ] && /usr/bin/diff -q /etc/ntp.conf /etc/ntp.conf.predhclient.$interface >/dev/null 2>&1; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
/sbin/service ntpd condrestart >/dev/null 2>&1
|
/sbin/service ntpd condrestart >/dev/null 2>&1
|
||||||
@ -480,31 +480,36 @@ fi
|
|||||||
|
|
||||||
if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
|
if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
|
||||||
|| [ x$reason = xSTOP ]; then
|
|| [ x$reason = xSTOP ]; then
|
||||||
if [ -f /etc/resolv.conf.predhclient ]; then
|
# only restore config files if there are no other dhclient processes
|
||||||
change_resolv_conf /etc/resolv.conf.predhclient
|
# running (#306381)
|
||||||
rm -f /etc/resolv.conf.predhclient
|
any_other_clients="$(/bin/ps -eo pid,ppid,comm | /bin/grep dhclient | /bin/grep -v $PPID)"
|
||||||
fi
|
if [ -n "$any_other_clients" ]; then
|
||||||
|
if [ -f /etc/resolv.conf.predhclient.$interface ]; then
|
||||||
if [ -n "$DHCP_TIME_OFFSET_SETS_TIMEZONE" ] && [[ "$DHCP_TIME_OFFSET_SETS_TIMEZONE" = [yY1]* ]]; then
|
change_resolv_conf /etc/resolv.conf.predhclient.$interface
|
||||||
if [ -e /etc/localtime.predhclient ]; then
|
rm -f /etc/resolv.conf.predhclient.$interface
|
||||||
/bin/rm -f /etc/localtime
|
|
||||||
/bin/mv -f /etc/localtime.predhclient /etc/localtime
|
|
||||||
/bin/touch /etc/localtime
|
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/ntp.conf.predhclient ]; then
|
if [ -n "$DHCP_TIME_OFFSET_SETS_TIMEZONE" ] && [[ "$DHCP_TIME_OFFSET_SETS_TIMEZONE" = [yY1]* ]]; then
|
||||||
/bin/rm -f /etc/ntp.conf
|
if [ -e /etc/localtime.predhclient.$interface ]; then
|
||||||
/bin/mv -f /etc/ntp.conf.predhclient /etc/ntp.conf
|
/bin/rm -f /etc/localtime
|
||||||
service ntpd condrestart >/dev/null 2>&1
|
/bin/mv -f /etc/localtime.predhclient.$interface /etc/localtime
|
||||||
fi
|
/bin/touch /etc/localtime
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f /etc/yp.conf.predhclient ]; then
|
if [ -f /etc/ntp.conf.predhclient.$interface ]; then
|
||||||
/bin/rm -f /etc/yp.conf
|
/bin/rm -f /etc/ntp.conf
|
||||||
/bin/mv -f /etc/yp.conf.predhclient /etc/yp.conf
|
/bin/mv -f /etc/ntp.conf.predhclient.$interface /etc/ntp.conf
|
||||||
|
service ntpd condrestart >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -r /var/run/ypbind.pid ] && yppid=$(cat /var/run/ypbind.pid) && [ -d /proc/${yppid} ] && [ "$(if [ -x /usr/bin/readlink ]; then readlink /proc/${yppid}/exe; else echo /sbin/ypbind; fi)" = "/sbin/ypbind" ]; then
|
if [ -f /etc/yp.conf.predhclient.$interface ]; then
|
||||||
kill -HUP $yppid
|
/bin/rm -f /etc/yp.conf
|
||||||
|
/bin/mv -f /etc/yp.conf.predhclient.$interface /etc/yp.conf
|
||||||
|
|
||||||
|
if [ -r /var/run/ypbind.pid ] && yppid=$(cat /var/run/ypbind.pid) && [ -d /proc/${yppid} ] && [ "$(if [ -x /usr/bin/readlink ]; then readlink /proc/${yppid}/exe; else echo /sbin/ypbind; fi)" = "/sbin/ypbind" ]; then
|
||||||
|
kill -HUP $yppid
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user