2

I'm trying to troubleshoot an issue on a MediaTemple server (running CentOS5) where the DNS cache has grown stale - I think because nscd has crashed. I've tried restarting nscd:

# service nscd restart
Stopping nscd:                                             [FAILED]
Starting nscd:                                             [  OK  ]

This makes sense since I believe nscd has crashed so it shouldn't already be running, but When I view the status of nscd:

# service nscd status
nscd dead but subsys locked

And ps -A returns no processes related to nscd (I assume because it's dead). I've edited /etc/nscd.conf and uncommented the line that defines the location for the log file. It created the file but it never writes anything to it.

I tried looking at the init script but found that it's no help since the script thinks everything is running fine - the service returns that it started up correctly.

How do I 'unlock' the subsys that nscd is complaining about?

EEAA
  • 110,608
Phunt
  • 45

4 Answers4

0

Unfortunately these are bugs in the nscd init scripts and thhe status has no meaning. The init script is expecting the pid file to be /var/run/nscd.pid (which it would be if the init script was writing the pid file). Alas, nscd itself writes its pid file to /var/run/nscd/nscd.pid.

To simplify, try troubleshooting with nscd off.

If you want to know what ncsd is failing to start examine the output of strace -f /usr/sbin/nscd.

Mark Wagner
  • 18,428
0

Explore the option of the package bind-chroot (and its dependencies). Simply yum install and modify your /etc/resolv.conf to point at 127.0.0.1. It is bit more robust than nscd out of the gates.

ForgeMan
  • 401
0

Nscd writes it's cache files to disk. I've seen problems with it before where it crashes starting if there's a problem reading this cache. Try deleting any files in the cache directory (should be /var/cache/nscd) and restarting nscd again.

0

I had a slightly different issue - I think it arose from running out of disk space on the system partition. I killed the service using $ sudo kill <pid>, then delete nscd.pid, then start the service. file location may differ based on OS and flavor. For CentOS (and presumably other Redhat variants), /var/run/nscd/nscd.pid

Startup:

$ sudo service nscd start

Nick
  • 131