Bug 471126 - dhclient-script in dhcp-4.0.0-30 destroys /etc/ntp.conf and /etc/resolv.conf
Summary: dhclient-script in dhcp-4.0.0-30 destroys /etc/ntp.conf and /etc/resolv.conf
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dhcp
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dave Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 470928
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-11 21:41 UTC by Dave Cantrell
Modified: 2008-12-07 04:16 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-12-07 04:16:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Cantrell 2008-11-11 21:41:38 UTC
+++ This bug was initially created as a clone of Bug #470928 +++

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.

--- Additional comment from safari-ml-redhat-bugzilla-ptwabx4ymfxc4p4xju5ie7abi5wrsukshf2evzxn.iki.fi on 2008-11-11 05:31:24 EDT ---

Now it works, my config files survived!  Thanks.

--- Additional comment from dcantrell on 2008-11-10 23:23:20 EDT ---

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

--- Additional comment from safari-ml-redhat-bugzilla-ptwabx4ymfxc4p4xju5ie7abi5wrsukshf2evzxn.iki.fi on 2008-11-10 17:18:46 EDT ---

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

--- Additional comment from dcantrell on 2008-11-10 17:10:23 EDT ---

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?

--- Additional comment from safari-ml-redhat-bugzilla-ptwabx4ymfxc4p4xju5ie7abi5wrsukshf2evzxn.iki.fi on 2008-11-10 16:54:56 EDT ---

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 Fedora Update System 2008-11-11 22:03:35 UTC
dhcp-4.0.0-22.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/dhcp-4.0.0-22.fc9

Comment 2 Fedora Update System 2008-11-13 03:35:17 UTC
dhcp-4.0.0-22.fc9 has been pushed to the Fedora 9 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/F9/FEDORA-2008-9615

Comment 3 Fedora Update System 2008-12-07 04:15:59 UTC
dhcp-4.0.0-22.fc9 has been pushed to the Fedora 9 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.