about summary refs log tree commit diff
path: root/services/nfs-server/run
diff options
context:
space:
mode:
authorEnno Boland <g@s01.de>2014-09-05 18:23:35 +0200
committerEnno Boland <g@s01.de>2014-09-05 18:23:35 +0200
commit67c9f63e8736dbf47cc1071a9d97098850cb4190 (patch)
tree9798326d508fb7e8b8d2b9f95276bd81844472f7 /services/nfs-server/run
parente46f3b8a06eea8a0691c105743171332ddda5911 (diff)
downloadrunit-void-67c9f63e8736dbf47cc1071a9d97098850cb4190.tar.gz
runit-void-67c9f63e8736dbf47cc1071a9d97098850cb4190.tar.xz
runit-void-67c9f63e8736dbf47cc1071a9d97098850cb4190.zip
New services: nfs-server, statd.
Diffstat (limited to 'services/nfs-server/run')
-rw-r--r--services/nfs-server/run31
1 files changed, 31 insertions, 0 deletions
diff --git a/services/nfs-server/run b/services/nfs-server/run
new file mode 100644
index 0000000..630f700
--- /dev/null
+++ b/services/nfs-server/run
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# Make sure the statd service is running.
+sv check statd
+
+# Get the nfs service parameters from the LFS standard file
+# this sets some envars.
+source /etc/conf.d/nfs-server.conf
+
+echo "Loading kernel modules"
+modprobe sunrpc
+modprobe nfs
+modprobe nfsd
+
+echo "Mounting pipefs filesystem"
+mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs defaults
+
+# Uncomment this and add the two daemons if you need kerberos support.
+# sv check idmapd gssd
+
+echo "Mounting NFS filesystem"
+mount -t nfsd nfsd /proc/fs/nfsd
+
+echo "Re-export all directories in /etc/exports"
+/usr/sbin/exportfs -ra > /dev/null
+
+echo "start some nfsd threads"
+/usr/sbin/rpc.nfsd -- $PROCESSES
+
+echo "Start the rpc.mountd daemon"
+exec /usr/sbin/rpc.mountd --foreground