rpc.pipefs.initd 763 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/openrc-run
  2. # Copyright 1999-2014 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. MNT="/var/lib/nfs/rpc_pipefs"
  5. mount_pipefs() {
  6. local fstype=rpc_pipefs
  7. # if things are already mounted, nothing to do
  8. mountinfo -q ${MNT} && return 0
  9. # if rpc_pipefs is not available, try to load sunrpc for it #219566
  10. grep -qs ${fstype} /proc/filesystems || modprobe -q sunrpc
  11. # if still not available, the `mount` will issue an error for the user
  12. # now just do it for kicks
  13. mkdir -p ${MNT}
  14. mount -t ${fstype} ${fstype} ${MNT}
  15. }
  16. start() {
  17. ebegin "Setting up RPC pipefs"
  18. mount_pipefs
  19. eend $? "make sure you have NFS/SUNRPC enabled in your kernel"
  20. }
  21. stop() {
  22. ebegin "Unmounting RPC pipefs"
  23. umount ${MNT}
  24. eend $?
  25. }