Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 84544

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] ServerAssignee: Network Filesystems <net-fs>
Severity: major    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Package list:
Runtime testing required: ---
Attachments: Applying this diff lets me stop/restart nfs

Description Magnus Lidbom 2005-03-08 13:24:19 UTC
Whenever i run 
/etc/init.d/nfs stop or /etc/init.d/nfs restart

Reproducible: Always
Steps to Reproduce:
1./etc/init.d/nfs restart

emerge info
Portage (default-linux/x86/2004.3, gcc-3.4.3, glibc-,
2.6.9-gentoo-r13 i686)
System uname: 2.6.9-gentoo-r13 i686 Celeron (Mendocino)
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.2.3-r5,dev-lang/python-2.3.4-r1 [2.3.4
(#1, Feb  7 2005, 12:17:14)]
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.2.3-r5, 2.3.4-r1
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.5, 1.7.9-r1, 1.6.3, 1.4_p6, 1.9.4, 1.8.5-r3
sys-devel/libtool:   1.5.10-r4
CFLAGS="-O3 -march=pentium2 -fforce-addr -momit-leaf-frame-pointer
-fomit-frame-pointer -ftracer -pipe"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/init.d /etc/env.d"
CXXFLAGS="-O3 -march=pentium2 -fforce-addr -momit-leaf-frame-pointer
-fomit-frame-pointer -ftracer -pipe -fvisibility-inlines-hidden"
FEATURES="autoaddcvs autoconfig ccache distcc distlocks sandbox sfperms"
USE="X apache2 apm arts avi berkdb bindist bitmap-fonts cdr crypt cups curl dga
directfb dvd dvdr emacs emboss encode esd f77 fam fbcon flac font-server
foomaticdb fortran freetds gcj gdbm gif gpm gtk gtk2 gtkhtml imap imlib ipv6
java jpeg junit kde libg++ libwww mad mbox mikmod mmx motif mozilla mp3 mpeg
ncurses nls nntp nptl odbc oggvorbis opengl oss pam pdflib perl pic png pthreads
python qt quicktime readline ruby samba scanner sdl slang spell ssl svga tcltk
tcpd tetex tiff truetype truetype-fonts type1-fonts unicode usb videos wxwindows
x86 xml2 xmms xv zlib video_cards_nvidia"
Comment 1 Magnus Lidbom 2005-03-08 13:26:58 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.
Comment 2 SpanKY gentoo-dev 2005-03-14 21:25:09 UTC
that doesnt make any sense ... the hunk you posted is only run when start() is called, not stop()
Comment 3 Magnus Lidbom 2005-03-15 00:10:59 UTC
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.
Comment 4 Paul Taylor 2006-06-10 16:38:37 UTC
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.
Comment 5 Paul Taylor 2006-06-10 16:41:39 UTC
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.)
Comment 6 SpanKY gentoo-dev 2006-06-10 16:59:35 UTC
unrelated issue
Comment 7 SpanKY gentoo-dev 2006-06-10 17:00:50 UTC
(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
Comment 8 SpanKY gentoo-dev 2006-06-10 17:24:55 UTC
`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