Bug 230210

Summary: starting nscd in a temporary directory prevents paranoia mode from working
Product: Red Hat Enterprise Linux 4 Reporter: Sean Dilda <agrajag>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-02-28 08:21:12 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 Sean Dilda 2007-02-27 14:49:30 UTC
On some of my hosts, I've enabled paranoia mode in nscd with a restart time of 5
minutes.

In addition to this, we have a nightly cronjob that restarts nscd.  When this
cronjob runs, it creates a temporary directory and cd's into it and does
everything from there.   Shortly after running this script, we get this in the logs:

Feb 27 03:17:49 webhost-03 nscd: nscd startup succeeded
Feb 27 03:23:02 webhost-03 nscd: 13651 cannot change to old working directory:
No such file or directory; disabling paranoia mode

Exactly 5 minutes after startup (when paranoia mode would kick in), it tries to
cd to the temporary directory and fails (since it no longer exists), thus
disabled paranoia mode.    When I change our script to cd to / before starting
nscd, this problem goes away.


For a fix, nscd should cd to / and forget all about whatever directory it was
started from.   A simpler fix may be to force the 'cd /' in the init script.

Comment 1 Jakub Jelinek 2007-02-28 08:21:12 UTC
I think you should do it in your script rather than in nscd or in the init
script.  Many people intentionally start the daemon from a particular directory
so that it can e.g. drop core files in that directory if something bad happens.