aboutsummaryrefslogtreecommitdiffstats
path: root/main/nfs-utils/rpc.pipefs.initd
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2017-05-04 13:18:10 +0200
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-06-02 08:38:43 +0000
commit0539ae2c06949e1f06e94e9935ae4ad29ddcbe65 (patch)
tree963f42f4bb421eab4a2b6347e706f9a7c45615a1 /main/nfs-utils/rpc.pipefs.initd
parenta620b1fb4986945317b653290dcaf3855d7ace6e (diff)
downloadaports-0539ae2c06949e1f06e94e9935ae4ad29ddcbe65.tar.bz2
aports-0539ae2c06949e1f06e94e9935ae4ad29ddcbe65.tar.xz
main/nfs-utils: update OpenRC services from Gentoo
Diffstat (limited to 'main/nfs-utils/rpc.pipefs.initd')
-rw-r--r--main/nfs-utils/rpc.pipefs.initd30
1 files changed, 19 insertions, 11 deletions
diff --git a/main/nfs-utils/rpc.pipefs.initd b/main/nfs-utils/rpc.pipefs.initd
index 400b66fd5f..f971a49b39 100644
--- a/main/nfs-utils/rpc.pipefs.initd
+++ b/main/nfs-utils/rpc.pipefs.initd
@@ -1,24 +1,32 @@
#!/sbin/openrc-run
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/rpc.pipefs.initd,v 1.1 2008/10/26 09:02:47 vapier Exp $
+
+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 rpc_pipefs /proc/filesystems || modprobe -q sunrpc
- # if still not available, let's bail
- grep -qs rpc_pipefs /proc/filesystems || return 1
+ 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 /var/lib/nfs/rpc_pipefs
- mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
+ mkdir -p ${MNT}
+ mount -t ${fstype} ${fstype} ${MNT}
}
start() {
- # if things are already mounted, let's just return
- grep -qs "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts && return 0
-
- ebegin "Mounting RPC pipefs"
+ 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 $?
}