Summary: | /etc/init.d/nfs stop always reports: Error stopping NFS statd same for restart | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Magnus Lidbom <magnus.lidbom> |
Component: | [OLD] Server | Assignee: | Network Filesystems <net-fs> |
Status: | RESOLVED NEEDINFO | ||
Severity: | major | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Applying this diff lets me stop/restart nfs |
Description
Magnus Lidbom
2005-03-08 13:24:19 UTC
Created attachment 52962 [details, diff]
Applying this diff lets me stop/restart nfs
I'm a complete newbie at linux scripts, so this may well not be the correct
fix. IT works for me though.
that doesnt make any sense ... the hunk you posted is only run when start() is called, not stop() It does make sense. The line: killall -0 rpc.statd &>/dev/null && return 0 always returns at the very beginning of the start_statd function, so the rest of the function: ebegin "Starting NFS statd" start-stop-daemon --start --quiet --exec \ $statd -- $RPCSTATDOPTS 1>&2 is never executed and NFS statd is never started, so stopping it will always fail. Removing the "&& return 0" part of the line lets the rest of the function execute so that statd is started and stopping it works. Here's the output I get: # /etc/init.d/nfs restart * Stopping NFS mountd ... [ ok ] * Stopping NFS daemon ... [ ok ] * Stopping NFS statd ... [ ok ] * Stopping idmapd ... [ ok ] * Starting idmapd ... [ ok ] * Starting NFS statd ... /sbin/start-stop-daemon: stat /sbin/rpc.statd: No such file or directory (No such file or directory) * Error starting NFS statd [ !! ] * Exporting NFS directories ... [ ok ] * Starting NFS daemon ... [ ok ] * Starting NFS mountd ... [ ok ] The cause is an incorrect path to rpc.statd in /etc/init.d/nfs (line 266); change this to "/usr/sbin/rpc.statd", and the script works correctly. Correction: That should be line 29 of /etc/init.d/nfs Addendum: The same change needs to be made to /etc/init.d/nfsmount (lines 15 and 26.) unrelated issue (In reply to comment #3) > It does make sense. The line: > > killall -0 rpc.statd &>/dev/null && return 0 > > always returns at the very beginning of the start_statd function you dont get the point of the test removing the return just ignores the issue `killall -0` is a test to see if rpc.statd is running if killall -0 returns true, that means rpc.statd is already running thus there is no need to have the init.d script start it |