summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/nfs-utils/files/nfs-utils.postinst1
-rw-r--r--package/nfs-utils/files/nfs.init34
2 files changed, 35 insertions, 0 deletions
diff --git a/package/nfs-utils/files/nfs-utils.postinst b/package/nfs-utils/files/nfs-utils.postinst
index 131ed1608..0334fcb40 100644
--- a/package/nfs-utils/files/nfs-utils.postinst
+++ b/package/nfs-utils/files/nfs-utils.postinst
@@ -1,6 +1,7 @@
#!/bin/sh
. $IPKG_INSTROOT/etc/functions.sh
add_rcconf "kernel nfs server" nfs_server NO
+add_rcconf "kernel nfs client (v4)" nfs_client NO
add_rcconf "kernel nfs server version" nfs_server_version 3
add_service nfs 2049/tcp
add_service nfs 2049/udp
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 $?