I've been spending a happy day re-building my Linux server. It has been off for ages. After the network address kept changing when I tried to force the Netgear to do things it just didn't want to do I'd turned it off. Today I decided, mostly because I wanted to play with LDAP, to get it back on the network.
Getting it back on the network was easy enough, I just had to plug a keyboard in and use my single monitor plugged into it briefly.
Once up on the network, re-configuring most of the services to use the new IP address was easy, but despite me configuring BIND with the new details, it just would not start.
Here is the error I found in the syslog
named[4035]: couldn't open pid file '/var/run/bind/run/named/named.pid': Stale NFS file handle
Now this is odd as I don't use NFS and I don't have an automounter of any description.
A quick Google found me a solution, perform an fsck. One other person had fixed his problem that way - by dint of going down to single user mode and doing a manual fsck. Well, by now, I'd unplugged the keyboard and put the monitor back on the XP box, so I wanted to avoid doing the single user thing if possible.
If you want to ensure your system performs an fsck on reboot, irrespective of the settings of any tuneable paramaters on the fileing system, the thing to do is
shutdown -rF now
The -r ensures a reboot takes place, the -F (note the capital) ensures that an fsck occurs and of course, the operand at the end causes the shutdown to take place at the time you type it.
Quite why a stray corruption on the filing system should make the kernel think there is an odd NFS file handle in use I'm not sure. Probably a bit of magic in the corrupted file, but its easily fixed with this arrangement and of course, if you were working with a server located in a hosted environment, it would work on that without a major downtime. Just advise the data centre staff that you're rebooting the box so that a pair of "intelligent hands" is ready should the fsck go pear shaped.