Bug 63946 - nscd not restarted after changing /etc/resolv.conf
nscd not restarted after changing /etc/resolv.conf
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-22 10:59 EDT by diego.santacruz
Modified: 2014-03-16 22:27 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-20 12:11:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description diego.santacruz 2002-04-22 10:59:55 EDT
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 10:48:23 EDT
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 12:11:02 EDT
This is fixed in current RHEL3 update releases, RHEL 4, and FC2/FC3+.

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