Bug 230210 - starting nscd in a temporary directory prevents paranoia mode from working
Summary: starting nscd in a temporary directory prevents paranoia mode from working
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-27 14:49 UTC by Sean Dilda
Modified: 2016-11-24 12:45 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2007-02-28 08:21:12 UTC


Attachments (Terms of Use)

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.


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