summaryrefslogtreecommitdiff
path: root/package/nfs-utils/files/nfs.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/nfs-utils/files/nfs.init')
-rw-r--r--package/nfs-utils/files/nfs.init34
1 files changed, 34 insertions, 0 deletions
diff --git a/package/nfs-utils/files/nfs.init b/package/nfs-utils/files/nfs.init
new file mode 100644
index 000000000..8944ef2e2
--- /dev/null
+++ b/package/nfs-utils/files/nfs.init
@@ -0,0 +1,34 @@
+#!/bin/sh
+#PKG nfs-utils
+#INIT 70
+
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${portmap:-NO}" = x"NO" && test x"${rpcbind:-NO}" = x"NO" && exit 0
+ test x"${nfs_client:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mkdir -p /var/lib/nfs/rpc_pipefs
+ mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
+ /usr/sbin/idmapd
+ /usr/sbin/gssd
+ ;;
+stop)
+ kill $(pgrep -f /usr/sbin/idmapd)
+ kill $(pgrep -f /usr/sbin/gssd)
+ umount /var/lib/nfs/rpc_pipefs
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?