Red Hat Bugzilla – Bug 230210
starting nscd in a temporary directory prevents paranoia mode from working
Last modified: 2014-01-21 17:57:22 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.
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.