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 2.0.51.19 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.4.20040808-r1, 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/binutils: 2.15.92.0.2-r1 sys-devel/libtool: 1.5.10-r4 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O3 -march=pentium2 -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer -pipe" CHOST="i686-pc-linux-gnu" 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" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distcc distlocks sandbox sfperms" GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/ ftp://ftp.du.se/pub/os/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" 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" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
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