From 15eddd925db762657fae2131d3d9d33888760757 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 10 Jan 2019 16:34:45 +0000 Subject: user/nfs-utils: new package --- user/nfs-utils/rpc.pipefs.initd | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 user/nfs-utils/rpc.pipefs.initd (limited to 'user/nfs-utils/rpc.pipefs.initd') diff --git a/user/nfs-utils/rpc.pipefs.initd b/user/nfs-utils/rpc.pipefs.initd new file mode 100644 index 000000000..f971a49b3 --- /dev/null +++ b/user/nfs-utils/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 $? +} -- cgit v1.2.3-60-g2f50