Bug 230210 - starting nscd in a temporary directory prevents paranoia mode from working
starting nscd in a temporary directory prevents paranoia mode from working
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2007-02-27 09:49 EST by Sean Dilda
Modified: 2016-11-24 07:45 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-02-28 03:21:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Sean Dilda 2007-02-27 09:49:30 EST
On some of my hosts, I've enabled paranoia mode in nscd with a restart time of 5

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 03:21:12 EST
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.

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