nfsroot: statd is only needed for nfs4
authorPhilippe Seewer <philippe.seewer@bfh.ch>
Tue, 16 Jun 2009 08:31:29 +0000 (10:31 +0200)
committerPhilippe Seewer <philippe.seewer@bfh.ch>
Wed, 17 Jun 2009 06:37:39 +0000 (08:37 +0200)
rpc.statd is only needed for NFSv4, because it's required for
locking. We don't support locking for NFSv2/3, so start it only
if we are mount from NFSv4.

modules.d/95nfs/nfsroot

index 23fc3aa..d0189be 100755 (executable)
@@ -65,12 +65,10 @@ incol2 /proc/filesystems nfs4 || modprobe nfs || exit 1
 
 # XXX don't forget to move /var/lib/nfs/rpc_pipefs to new /
 
-# Start rpcbind and rpc.statd as mount won't let us use locks on a NFSv4
-# filesystem without talking to them, even though they are unneeded
+# Start rpcbind or rpcbind
 # XXX occasionally saw 'rpcbind: fork failed: No such device' -- why?
 [ -x /sbin/portmap ] && [ -z "$(pidof portmap)" ] && portmap
 [ -x /sbin/rpcbind ] && [ -z "$(pidof rpcbind)" ] && rpcbind
-[ -n "$(pidof rpc.statd)" ] || rpc.statd
 
 # XXX should I do rpc.idmapd here, or wait and start in the new root
 # XXX waiting assumes root can read everything it needs right up until
@@ -79,6 +77,8 @@ incol2 /proc/filesystems nfs4 || modprobe nfs || exit 1
 # XXX really, want to retry in a loop I think, but not here...
 
 if [ "$nfsver" = "nfs4" ]; then
+    [ -n "$(pidof rpc.statd)" ] || rpc.statd
+
     # XXX really needed? Do we need non-root users before we start it in
     # XXX the real root image?
     if [ -z "$(pidof rpc.idmapd)" ]; then