Bug 63946

Summary: nscd not restarted after changing /etc/resolv.conf
Product: [Retired] Red Hat Linux Reporter: diego.santacruz
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED CURRENTRELEASE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: jlamb, rvokal, tao
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: 2005-04-20 16:11: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 diego.santacruz 2002-04-22 14:59:55 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020326

Description of problem:
/etc/sysconfig/network-scripts/ifup-post will change /etc/resolv.conf according
to the autotected DNS servers. However, the nscd service is not restarted and
thus the old DNS servers are still used while doing lookups.

Current behaviour is really misleading, since all hostname lookups fail without
any apparanet explanation to the user.

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

6.43-1


How reproducible:
Always

Steps to Reproduce:
1. service nscd start
2. connect a network device that autoconfigures DNS (e.g., ppp) 
3. after connection is up attempt to access some existing network name (e.g.,
ping altavista.com)
	

Actual Results:  All name lookups fail, since nscd tries to reach invalid DNS
servers.

Expected Results:  nscd is made aware of the changed /etc/resolv.conf

Additional info:

adding a call like

    service nscd condrestart > /dev/null 2>&1

in /etc/sysconfig/network-scripts/ifup-post when /etc/resolv.conf is modified
should solve the problem.

Comment 1 diego.santacruz 2002-06-19 14:48:23 UTC
Maybe something along the lines of

# If the resolver settings where adjusted after nscd started, restart to make
# it take into account the new DNS servers.
if [ -f /var/lock/subsys/nscd -a /etc/resolv.conf -nt /var/lock/subsys/nscd ]; then
        # Make nscd aware of new name resolver settings
        [ -x /etc/init.d/nscd ] && /etc/init.d/nscd condrestart
fi

to add in ifup-post would be a good fix. I have these lines above (with an extra
workaround for bug #64603) in /sbin/ifup-local and it works like a charm.

Comment 2 Bill Nottingham 2005-04-20 16:11:02 UTC
This is fixed in current RHEL3 update releases, RHEL 4, and FC2/FC3+.