This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 470928 - dhclient-script in dhcp-4.0.0-30 destroys /etc/ntp.conf and /etc/resolv.conf
dhclient-script in dhcp-4.0.0-30 destroys /etc/ntp.conf and /etc/resolv.conf
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
10
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 471126
  Show dependency treegraph
 
Reported: 2008-11-10 16:54 EST by Sami Farin
Modified: 2009-05-03 14:16 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-12-06 23:15:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Sami Farin 2008-11-10 16:54:56 EST
Description of problem:
dhcp-4.0.0-18 behaved when I had in /etc/sysconfig/network-scripts/ifcfg-eth0 :
DEVICE=eth0
ONBOOT=no
BOOTPROTO=dhcp
NOZEROCONF=yes
PEERDNS=no
PEERNTP=no
PEERNIS=no
PERSISTENT_DHCLIENT=yes
MTU=1472
IPV6TO4INIT=no
IPV6INIT=no

But dhcp-4.0.0-30 tries to be smart and overwrites them.

Version-Release number of selected component (if applicable):
4.0.0-30

How reproducible:
always

Steps to Reproduce:
1. ifup eth0
2.
3.
  
Actual results:
dhclient-script ignore PEERDNS and PEERNTP.

Expected results:
Not writing crap to my /etc/resolv.conf and /etc/ntp.conf .

Additional info:
Comment 1 David Cantrell 2008-11-10 17:10:23 EST
I see what's happening here.  A change went in to the -24 release to suppress errors from source_config() in instances where ifcfg-DEVICE did not exist, but ${CONFIG} is not the full path to the ifcfg-DEVICE file. Here's the fix:

Index: dhclient-script
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/F-10/dhclient-script,v
retrieving revision 1.3
diff -u -p -r1.3 dhclient-script
--- dhclient-script	1 Oct 2008 22:38:30 -0000	1.3
+++ dhclient-script	10 Nov 2008 22:06:32 -0000
@@ -452,10 +452,7 @@ fi
 
 CONFIG="${interface}"
 need_config ${CONFIG}
-
-if [ -f "${CONFIG}" ]; then
-    source_config
-fi
+source_config >/dev/null 2>&1
 
 if [ -n "${new_subnet_mask}" ]; then
     new_prefix="$(ipcalc -p ${new_ip_address} ${new_subnet_mask} | cut -d '=' -f 2)"

Can you make this change locally to your /sbin/dhclient-script and test it out?
Comment 2 Sami Farin 2008-11-10 17:18:46 EST
Did not help, unfortunately.

root     16124  0.0  0.0  16880   824 ?        Ss   Nov10   0:00 /sbin/dhclient -q -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0
[root@safari /sbin]# kill 16124
[root@safari /sbin]# cd /etc
[root@safari /etc]# chattr -i ntp.conf resolv.conf
[root@safari /etc]# l ntp.conf resolv.conf
-rw------- 1 root root  2559 2006-06-16 00:09:25.447898000 +0300 ntp.conf
-rw-r--r-- 1 root xuser   22 2008-11-10 23:33:26.026538779 +0200 resolv.conf
[root@safari /etc]# /sbin/dhclient -q -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0&
[2] 18386
[root@safari /etc]# l ntp.conf resolv.conf
-rw-r--r-- 1 root xuser 2726 2008-11-11 00:14:01.639538809 +0200 ntp.conf
-rw-r--r-- 1 root xuser  108 2008-11-11 00:14:01.597539991 +0200 resolv.conf
Comment 3 David Cantrell 2008-11-10 23:23:20 EST
Can you try this patch:

Index: dhclient-script
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/F-10/dhclient-script,v
retrieving revision 1.3
diff -u -p -r1.3 dhclient-script
--- dhclient-script	1 Oct 2008 22:38:30 -0000	1.3
+++ dhclient-script	11 Nov 2008 04:20:53 -0000
@@ -451,10 +451,10 @@ if [ -f /etc/sysconfig/networking/networ
 fi
 
 CONFIG="${interface}"
-need_config ${CONFIG}
-
-if [ -f "${CONFIG}" ]; then
-    source_config
+if [ -d /etc/sysconfig/network-scripts ]; then
+    cd /etc/sysconfig/network-scripts
+    need_config ${CONFIG}
+    source_config >/dev/null 2>&1
 fi
 
 if [ -n "${new_subnet_mask}" ]; then
Comment 4 Sami Farin 2008-11-11 05:31:24 EST
Now it works, my config files survived!  Thanks.
Comment 5 David Cantrell 2008-11-11 14:42:38 EST
Thanks for helping with testing out the patches.  I will put this fix in to an update for F-10.  The update should be available when F-10 ships.
Comment 6 Sami Farin 2008-11-11 16:52:13 EST
But when I reboot, it still tries to overwrite /etc/ntp.conf.
Comment 7 Fedora Update System 2008-11-22 11:46:10 EST
dhcp-4.0.0-32.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dhcp'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/f10/FEDORA-2008-9915
Comment 8 Bug Zapper 2008-11-26 00:09:43 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 9 Fedora Update System 2008-12-06 23:15:26 EST
dhcp-4.0.0-32.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

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