]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - debian/nfs-kernel-server.init
More changes in the same version:
[nfs-utils.git] / debian / nfs-kernel-server.init
index 1626213119b2c6af24c9922e97a93ec2d1c2feab..548b5e057ffc0a78879617a3494c7a205f13cdd6 100755 (executable)
@@ -21,13 +21,12 @@ DESC="NFS kernel daemon"
 RPCNFSDCOUNT=8 # Number of servers to be started up by default
 RPCMOUNTDOPTS=
 
-# Make sure that daemon cwds are in root fs.
-cd /
-
 # See how we were called.
 case "$1" in
   start)
-       if grep -q '^/' /etc/exports; then
+       cd /    # daemons should have root dir as cwd
+       if grep -q '^/' /etc/exports
+       then
                printf "Exporting directories for $DESC..."
                $PREFIX/sbin/exportfs -r
                echo "done."
@@ -37,8 +36,8 @@ case "$1" in
                start-stop-daemon --start --quiet \
                    --exec $PREFIX/sbin/rpc.nfsd -- $RPCNFSDCOUNT
                printf " mountd"
-               $PREFIX/bin/rpcinfo -u localhost nfs 3 > /dev/null 2>&1 ||
-                   RPCMOUNTDOPTS="$RPCMOUNDOPTS --no-nfs-version 3"
+               $PREFIX/bin/rpcinfo -u localhost nfs 3 >/dev/null 2>&1 ||
+                   RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3"
                start-stop-daemon --start --quiet \
                    --exec $PREFIX/sbin/rpc.mountd -- $RPCMOUNTDOPTS
                echo "."
@@ -50,10 +49,10 @@ case "$1" in
   stop)
        printf "Stopping $DESC: mountd"
        start-stop-daemon --stop --oknodo --quiet \
-           --exec $PREFIX/sbin/rpc.mountd
+           --name rpc.mountd --user 0
        printf " nfsd"
        start-stop-daemon --stop --oknodo --quiet \
-           --name nfsd --user root --signal 2
+           --name nfsd --user 0 --signal 2
        echo "."
 
        printf "Unexporting directories for $DESC..."