summaryrefslogtreecommitdiff
path: root/net-fs/nfs-utils/files/rpc.pipefs.initd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-fs/nfs-utils/files/rpc.pipefs.initd
reinit the tree, so we can have metadata
Diffstat (limited to 'net-fs/nfs-utils/files/rpc.pipefs.initd')
-rw-r--r--net-fs/nfs-utils/files/rpc.pipefs.initd32
1 files changed, 32 insertions, 0 deletions
diff --git a/net-fs/nfs-utils/files/rpc.pipefs.initd b/net-fs/nfs-utils/files/rpc.pipefs.initd
new file mode 100644
index 000000000000..f971a49b393e
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc.pipefs.initd
@@ -0,0 +1,32 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+MNT="/var/lib/nfs/rpc_pipefs"
+
+mount_pipefs() {
+ local fstype=rpc_pipefs
+
+ # if things are already mounted, nothing to do
+ mountinfo -q ${MNT} && return 0
+
+ # if rpc_pipefs is not available, try to load sunrpc for it #219566
+ grep -qs ${fstype} /proc/filesystems || modprobe -q sunrpc
+ # if still not available, the `mount` will issue an error for the user
+
+ # now just do it for kicks
+ mkdir -p ${MNT}
+ mount -t ${fstype} ${fstype} ${MNT}
+}
+
+start() {
+ ebegin "Setting up RPC pipefs"
+ mount_pipefs
+ eend $? "make sure you have NFS/SUNRPC enabled in your kernel"
+}
+
+stop() {
+ ebegin "Unmounting RPC pipefs"
+ umount ${MNT}
+ eend $?
+}