summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2011-02-16 17:32:11 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2011-02-16 17:32:11 +0100
commit775439d995f9b41ab0de32cede596e8aba405311 (patch)
tree25308b9f3a799a71c215e3a98eb9cff1ad4cc243
parentf4b95164315c8768eec732982500b1862edd3c33 (diff)
add client startup script, when using nfs4
-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 $?