summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/nfsd
diff options
context:
space:
mode:
authorJames Meyer <jams@linhes.org>2010-12-13 01:13:21 (GMT)
committerJames Meyer <jams@linhes.org>2010-12-13 01:13:21 (GMT)
commitd0c10b1079f1ad57c9c072e725687bf47d303a38 (patch)
tree2ac154217b43af8640f66a598882f641f7e7e4be /abs/core/runit-scripts/runitscripts/services/nfsd
parentb2ad14ffbef9ee223c4ce41235aa0af77d61053c (diff)
downloadlinhes_pkgbuild-d0c10b1079f1ad57c9c072e725687bf47d303a38.zip
linhes_pkgbuild-d0c10b1079f1ad57c9c072e725687bf47d303a38.tar.gz
linhes_pkgbuild-d0c10b1079f1ad57c9c072e725687bf47d303a38.tar.bz2
runit-scripts: update scripts to use nfs4
refs #735 closes #735
Diffstat (limited to 'abs/core/runit-scripts/runitscripts/services/nfsd')
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/nfsd/run63
1 files changed, 52 insertions, 11 deletions
diff --git a/abs/core/runit-scripts/runitscripts/services/nfsd/run b/abs/core/runit-scripts/runitscripts/services/nfsd/run
index 207d7cd..f043143 100755
--- a/abs/core/runit-scripts/runitscripts/services/nfsd/run
+++ b/abs/core/runit-scripts/runitscripts/services/nfsd/run
@@ -7,23 +7,64 @@ stat_runit "Starting NFSD"
# Make sure the statd daemon is up
# (the statd service must ensure portmap is running first)
-svwaitup /var/service/nfslock >/dev/null 2>/dev/null
+svwaitup /var/service/nfs-common >/dev/null 2>/dev/null
+
+source /etc/conf.d/nfs-server.conf
+
+NFSD="/usr/sbin/rpc.nfsd"
+
+
+
+# Default number of nfsd servers
+[ -z "$NFSD_COUNT" ] && NFSD_COUNT=8
+
+# Default mountpoint and options for nfsd filesystem
+[ -z "$PROCNFSD_MOUNTPOINT" ] && PROCNFSD_MOUNTPOINT="/proc/fs/nfsd"
+[ -z "$PROCNFSD_MOUNTOPTS" ] && PROCNFSD_MOUNTOPTS="rw,nodev,noexec,nosuid"
+
+do_modprobe() {
+ if [ -x /sbin/modprobe -a -f /proc/modules ]; then
+ modprobe -q "$1" || true
+ fi
+}
+
+
+
+do_mount() {
+ if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then
+ return 1
+ fi
+
+ if grep -vw "$1" /proc/mounts &> /dev/null ; then
+ if ! mountpoint -q "$2" ; then
+ mount -t "$1" "$1" "$2" -o "$3"
+ return
+ fi
+ fi
+ return 0
+}
+
+do_umount() {
+ if mountpoint -q "$1" ; then
+ umount "$1"
+ fi
+ return 0
+}
+
-source /etc/conf.d/nfs
-# Re-export all directories in /etc/exports
-/usr/sbin/exportfs -ra > /dev/null 2>/dev/null
# start some nfsd threads
printhl " Using ${NFSD_OPTS} "
-/usr/sbin/rpc.nfsd ${NFSD_OPTS} >/dev/null 2>/dev/null
+do_modprobe nfsd
+do_mount nfsd "$PROCNFSD_MOUNTPOINT" "$PROCNFSD_MOUNTOPTS"
+
+# Re-export all directories in /etc/exports
+/usr/sbin/exportfs -ra > /dev/null 2>/dev/null
-# since we are running kernel 2.6 we should also
-# mount the nfsd virtual filesystem
-printhl " mount nfsd"
-/bin/mount -t nfsd none /proc/fs/nfsd >/dev/null 2>/dev/null
+ $NFSD $NFSD_OPTS $NFSD_COUNT
-# Start the rpc.mountd daemon
-exec /usr/sbin/rpc.mountd --foreground >/dev/null 2>/dev/null
+#
+exec /usr/sbin/rpc.mountd --foreground >/dev/null 2>/dev/null