1
0

nfsd.init 879 B

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