nfsd.init 875 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. #FWINIT 70
  3. . /etc/rc.conf
  4. case $1 in
  5. autostop) ;;
  6. autostart)
  7. test x"${portmap:-NO}" = x"NO" && exit 0
  8. test x"${nfs_server:-NO}" = x"NO" && exit 0
  9. exec sh $0 start
  10. ;;
  11. start)
  12. /bin/mkdir -p /var/lib/nfs/v4recovery
  13. /bin/touch /var/lib/nfs/rmtab
  14. /bin/touch /var/lib/nfs/etab
  15. /bin/touch /var/lib/nfs/xtab
  16. /bin/touch /var/lib/nfs/sm
  17. chown nfs:nfs /var/lib/nfs/sm
  18. /usr/sbin/exportfs -r
  19. /usr/sbin/mountd
  20. /usr/sbin/nfsd
  21. /usr/sbin/statd
  22. if [ ${nfs_server_version} -eq 4 ];then
  23. mkdir -p /var/lib/nfs/rpc_pipefs
  24. mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
  25. /usr/sbin/idmapd
  26. /usr/sbin/svcgssd
  27. fi
  28. ;;
  29. stop)
  30. killall nfsd
  31. killall mountd
  32. killall statd
  33. if [ ${nfs_server_version} -eq 4 ];then
  34. killall idmapd
  35. killall svcgssd
  36. fi
  37. ;;
  38. restart)
  39. sh $0 stop
  40. sh $0 start
  41. ;;
  42. *)
  43. echo "Usage: $0 {start | stop | restart}"
  44. exit 1
  45. ;;
  46. esac
  47. exit $?