You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
886 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2006 OpenWrt.org
  3. START=99
  4. STOP=60
  5. USE_PROCD=1
  6. NFS_D=/var/lib/nfs
  7. RECOVERY_D=$NFS_D/v4recovery
  8. LOCK_D=/var/lib/nfs/sm
  9. VAR_NFS=/var/lib/nfs
  10. start_service() {
  11. grep -q /proc/fs/nfsd /proc/mounts || \
  12. mount -t nfsd nfsd /proc/fs/nfsd
  13. mkdir -p $NFS_D
  14. mkdir -p $RECOVERY_D
  15. mkdir -p $LOCK_D
  16. touch $NFS_D/rmtab
  17. mkdir -p $VAR_NFS
  18. chown nfs:nfs $VAR_NFS
  19. sysctl -w fs.nfs.nlm_tcpport=32777 fs.nfs.nlm_udpport=32777 > /dev/null
  20. procd_open_instance
  21. procd_set_param command /usr/sbin/rpc.statd -p 32778 -o 32779 -F
  22. procd_close_instance
  23. /usr/sbin/exportfs -r
  24. /usr/sbin/rpc.nfsd --grace-time 10
  25. procd_open_instance
  26. procd_set_param command /usr/sbin/rpc.mountd -p 32780 -F
  27. procd_close_instance
  28. }
  29. stop_service() {
  30. rpc.nfsd 0 2> /dev/null
  31. /usr/sbin/exportfs -au
  32. grep -q /proc/fs/nfsd /proc/mounts && \
  33. umount /proc/fs/nfsd
  34. }