Bug 66202

Summary: dhcpcd overwrites /etc/resolv.conf even with PEERDNS=no
Product: [Retired] Red Hat Linux Reporter: Romel Aranas <raranas>
Component: dhcpcdAssignee: Elliot Lee <sopwith>
Status: CLOSED CURRENTRELEASE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-07-07 15:28:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Romel Aranas 2002-06-06 04:08:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.79 [en] (Win98; U)

Description of problem:
Adding PEERDNS=no in ifcfg-eth0 doesn't prevent dhcpcd from overwriting 
/etc/resolv.conf.

To work around the problem, I found that moving the -R in DHCPCDARGS to the 
beginning, instead of at the end, seems to fix the problem.

/etc/sysconfig/network-scripts/ifup:

I changed these lines in ifup:
    if [ "${PEERDNS}" = "no" ]; then
       PUMPARGS="${PUMPARGS} -d"
       DHCPCDARGS="${DHCPCDARGS} -R"
    fi

to:

    if [ "${PEERDNS}" = "no" ]; then
       PUMPARGS="${PUMPARGS} -d"
       DHCPCDARGS="-R ${DHCPCDARGS}"  <== I moved the -R to the front
    fi


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


How reproducible:
Always

Steps to Reproduce:
1. Put PEERDNS=no in /etc/sysconfig/network-scripts/ifcfg-eth0
2. Make some proprietary changes to /etc/resolv.conf
3. /etc/rc.d/init.d/network restart
	

Actual Results:  /etc/resolv.conf is overwritten with new info from dhcpcd.

Expected Results:  /etc/resolv.conf should not have been changed.

Additional info:

My version of initscripts is 5.83-1.

Comment 1 Bill Nottingham 2002-06-06 15:16:45 UTC
Sounds like a bug in dhcpcd argument parsing; does the version in 7.3 fare better?