[Lunar-commits] <moonbase> nfs fixes, bump, new dependency

Jean-Michel Bruenn wdp at lunar-linux.org
Mon Apr 25 12:28:58 CEST 2011


commit 80ebed7ee5ff03088b3c9ae139a72c9604cc3ad7
Author: Jean-Michel Bruenn <wdp at lunar-linux.org>
Date:   Mon Apr 25 12:28:58 2011 +0200

    nfs fixes, bump, new dependency
---
 filesys/libnfsidmap/BUILD        |    5 ++
 filesys/libnfsidmap/DETAILS      |   12 ++++
 filesys/nfs-utils/BUILD          |   30 ++++-----
 filesys/nfs-utils/DEPENDS        |    3 +-
 filesys/nfs-utils/DETAILS        |    4 +-
 filesys/nfs-utils/init.d/nfs     |  125 +++++++++++++++++++++++++++++---------
 filesys/nfs-utils/init.d/nfslock |   24 -------
 filesys/nfs-utils/services       |    2 +
 8 files changed, 132 insertions(+), 73 deletions(-)

diff --git a/filesys/libnfsidmap/BUILD b/filesys/libnfsidmap/BUILD
new file mode 100644
index 0000000..8f06792
--- /dev/null
+++ b/filesys/libnfsidmap/BUILD
@@ -0,0 +1,5 @@
+(
+
+  default_build
+
+) > $C_FIFO 2>&1
diff --git a/filesys/libnfsidmap/DETAILS b/filesys/libnfsidmap/DETAILS
new file mode 100644
index 0000000..f99a1d7
--- /dev/null
+++ b/filesys/libnfsidmap/DETAILS
@@ -0,0 +1,12 @@
+          MODULE=libnfsidmap
+         VERSION=0.24
+          SOURCE=$MODULE-$VERSION.tar.gz
+      SOURCE_URL=http://www.citi.umich.edu/projects/nfsv4/linux/$MODULE/
+      SOURCE_VFY=sha1:3ced887b642d33ecabdd751ec7c4fb536347fba1
+        WEB_SITE=http://nfs.sourceforge.net
+           SHORT="Network File System ID thingy lib"
+         ENTERED=20110404
+         UPDATED=20110404
+cat << EOF
+....
+EOF
diff --git a/filesys/nfs-utils/BUILD b/filesys/nfs-utils/BUILD
index 471d69f..dc47af4 100644
--- a/filesys/nfs-utils/BUILD
+++ b/filesys/nfs-utils/BUILD
@@ -1,23 +1,19 @@
-unalias  make
-
 (
 
-# Adding enable-tirpc since there is no disbale counterpart in the configure.
-  ( source /var/lib/lunar/unset.sh && ./configure  --prefix=/usr  --mandir=/usr/share/man \
-    --disable-nfsv4 --disable-gss --enable-tirpc) &&
-
-  ( source /var/lib/lunar/unset.sh && make )   &&
-  prepare_install             &&
-  ( source /var/lib/lunar/unset.sh && make    install ) &&
+  add_priv_user nfs:daemon                               &&
 
-  if [ -e "/etc/init.d/nfslock.sh" ]; then
-     rm -f /etc/init.d/nfslock.sh
-     rm -f /etc/rc?.d/???nfslock.sh
-  fi &&
+  # please DO NOT remove --disable-tirpc even if ./configure shows
+  # no such option - it works, and without that there's a bug and
+  # thus rpc.mountd is not starting... <wdp at lunar-linux.org>
+  ./configure --prefix=/usr                               \
+              --mandir=/usr/share/man                     \
+	      --disable-tirpc                             \
+	      --disable-gss                               \
+	      --with-tcp-wrappers                         \
+	      $OPTS                                      &&
 
-  if [ -e "/etc/init.d/nfs.sh" ]; then
-    rm -f /etc/init.d/nfs.sh
-    rm -f /etc/rc?.d/???nfs.sh
-  fi
+  default_make                                           &&
+  devoke_installwatch                                    &&
+  chown -R nfs:daemon /var/lib/nfs
 
 ) > $C_FIFO 2>&1
diff --git a/filesys/nfs-utils/DEPENDS b/filesys/nfs-utils/DEPENDS
index 4c76fa8..bff0bd3 100644
--- a/filesys/nfs-utils/DEPENDS
+++ b/filesys/nfs-utils/DEPENDS
@@ -1,4 +1,5 @@
 depends portmap
 depends quota
 depends libcap
-depends libtirpc
+depends libevent
+depends libnfsidmap
diff --git a/filesys/nfs-utils/DETAILS b/filesys/nfs-utils/DETAILS
index 4a7a0ef..4f2567b 100644
--- a/filesys/nfs-utils/DETAILS
+++ b/filesys/nfs-utils/DETAILS
@@ -1,8 +1,8 @@
           MODULE=nfs-utils
-         VERSION=1.2.2
+         VERSION=1.2.3
           SOURCE=$MODULE-$VERSION.tar.bz2
       SOURCE_URL=$SFORGE_URL/nfs/
-      SOURCE_VFY=sha1:bf823cb85844de3ff3bf07601698aaa1cfdd8a28
+      SOURCE_VFY=sha1:da70a29191b07056d71b6e427a87d5cfd8628523
         WEB_SITE=http://nfs.sourceforge.net
            SHORT="Network File System"
          ENTERED=20011023
diff --git a/filesys/nfs-utils/init.d/nfs b/filesys/nfs-utils/init.d/nfs
index 11247be..e67d9cd 100755
--- a/filesys/nfs-utils/init.d/nfs
+++ b/filesys/nfs-utils/init.d/nfs
@@ -11,35 +11,102 @@
 
 [  -e /etc/exports  ]  ||  exit 0
 
-NUMSERVERS=8
-MOUNTDOPTS=
+# defaults, overriden if /etc/config.d/nfs exists and is filled
+# with NUMSERVERS and/or MOUNTDOPTS
+CONFIGFILE="/etc/config.d/nfs";
+
+#NUMSERVERS=8
+((AUTONUMSERVERS=$(cat /proc/cpuinfo  | grep "model name" | wc -l)*3))
+
+if [ -f $CONFIGFILE ]; then
+  . $CONFIGFILE
+fi
+
+NUMSERVERS=${NUMSERVERS:-$AUTONUMSERVERS}
+MOUNTDOPTS=${MOUNTDOPS:-""}
 
 case $1 in
-   start|restart)  echo "$1ing NFS services"
-                   exportfs -r 
-
-                   pkill      "^rpc.rquotad$"  &&  sleep  5
-                   pkill      "^rpc.mountd$"   &&  sleep  5
-                   pkill  -1  "^nfsd$"         &&  sleep  5
-                   pkill      "^rpc.statd$"    &&  sleep  5
-
-                   ps  -C  portmap  >  /dev/null  ||
-                   /etc/init.d/portmap start
-                   /usr/sbin/rpc.rquotad
-                   /usr/sbin/rpc.mountd  $MOUNTDOPTS
-                   /usr/sbin/rpc.nfsd    $NUMSERVERS
-                   /usr/sbin/rpc.statd
-                   ;;
-
-            stop)  echo "$1ping NFS services"
-                   /usr/sbin/exportfs -au
-    
-                   pkill      "^rpc.rquotad$"
-                   pkill      "^rpc.mountd$"
-                   pkill  -1  "^nfsd$"
-                   pkill      "^rpc.statd$"
-                   ;;
-
-               *)  echo "Usage: $0 {start|stop|restart}"
-                   ;;
+  start)  echo "$1ing NFS services"
+
+    if ps -C nfsd > /dev/null;  then
+      echo -n "NFS running already. Use stop first or restart..."
+      echo -e $RESULT_FAIL
+      exit 0
+    fi
+
+    ps -C portmap > /dev/null || /etc/init.d/portmap start
+
+    # mount /proc/fs/nfsd
+    if ! grep "/proc/fs/nfsd" /proc/mounts > /dev/null; then
+      if ! mount -t nfsd nfsd /proc/fs/nfsd; then
+        echo -n "Mounting /proc/fs/nfsd failed."
+	echo -e $RESULT_FAIL
+	exit 0
+      fi
+    fi
+
+    # mount rpc_pipefs
+    if ! grep "/var/lib/nfs/rpc_pipefs" /proc/mounts > /dev/null; then
+      if [ ! -d /var/lib/nfs/rpc_pipefs ]; then
+        mkdir -p /var/lib/nfs/rpc_pipefs
+      fi
+      if ! mount sunrpc -t rpc_pipefs /var/lib/nfs/rpc_pipefs/; then
+        echo -n "Mounting /var/lib/nfs/rpc_pipefs failed."
+        echo -e $RESULT_FAIL
+        exit 0
+      fi
+    fi
+
+    # It is important that exportfs be run before mountd so that
+    # mountd is working from current information (in
+    # /var/lib/nfs/etab)
+    exportfs -a 
+
+    if ! /usr/sbin/rpc.mountd $MOUNTDOPTS; then
+      echo -n "Starting rpc.mountd failed."
+      echo -e $RESULT_FAIL
+      exit 0
+    fi
+
+    if ! /usr/sbin/rpc.rquotad; then
+      echo -n "Starting rpc.rquotad failed."
+      echo -e $RESULT_FAIL
+      exit 0
+    fi
+
+    if ! /usr/sbin/rpc.nfsd $NUMSERVERS; then
+      echo -n "Starting rpc.nfsd failed."
+      echo -e $RESULT_FAIL
+      exit 0
+    fi
+    if ! /usr/sbin/rpc.statd; then
+      echo -n "Starting rpc.statd failed."
+      echo -e $RESULT_FAIL
+      exit 0
+    fi
+    exportfs -ra
+  ;;
+
+  stop)  echo "$1ping NFS services"
+    /usr/sbin/exportfs -au
+
+    pkill      "^rpc.rquotad$"
+    pkill      "^rpc.mountd$"
+    pkill  -1  "^nfsd$"
+    pkill      "^rpc.statd$"
+
+    # umount rpc_pipefs if mounted
+    if grep "rpc_pipefs" /proc/mounts > /dev/null; then
+      umount /var/lib/nfs/rpc_pipefs/
+    fi
+  ;;
+
+  restart) echo "$1ing NFS services"
+    $0 stop 
+    $0 start
+  ;;
+
+  *)  echo "Usage: $0 {start|stop|restart}"
+  ;;
+
 esac
diff --git a/filesys/nfs-utils/init.d/nfslock b/filesys/nfs-utils/init.d/nfslock
deleted file mode 100755
index 3443a6a..0000000
--- a/filesys/nfs-utils/init.d/nfslock
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-#
-# nfslock       This shell script takes care of starting and stopping
-#               the NFS file locking service.
-#
-# chkconfig: 345 14 86
-# description: NFS is a popular protocol for file sharing across \
-#              TCP/IP networks. This service provides NFS file \
-#              locking functionality.
-# probe: true
-
-case $1 in
-  start|restart)  echo   "$1ing NFS file locking services, rpc.statd"
-                  pkill  "^rpc.statd$"  &&  sleep  5
-                  ps  -C  portmap  >  /dev/null  ||
-                  /etc/init.d/portmap start
-                  /usr/sbin/rpc.statd
-                  ;;
-           stop)  echo "$1ping NFS file locking services"
-                  pkill  "^rpc.statd$"
-                  ;;
-              *)  echo "Usage $0 {start|stop|restart}"
-                  ;;
-esac
diff --git a/filesys/nfs-utils/services b/filesys/nfs-utils/services
new file mode 100644
index 0000000..3109fba
--- /dev/null
+++ b/filesys/nfs-utils/services
@@ -0,0 +1,2 @@
+nfs             2049/tcp
+nfs             2049/udp


More information about the Lunar-commits mailing list