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.

40 lines
805 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. start_service() {
  10. grep -q /proc/fs/nfsd /proc/mounts || \
  11. mount -t nfsd nfsd /proc/fs/nfsd
  12. mkdir -p $NFS_D
  13. mkdir -p $RECOVERY_D
  14. mkdir -p $LOCK_D
  15. touch $NFS_D/rmtab
  16. sysctl -w fs.nfs.nlm_tcpport=32777 fs.nfs.nlm_udpport=32777 > /dev/null
  17. procd_open_instance
  18. procd_set_param command /usr/sbin/rpc.statd -p 32778 -o 32779 -F
  19. procd_close_instance
  20. /usr/sbin/exportfs -r
  21. /usr/sbin/rpc.nfsd
  22. procd_open_instance
  23. procd_set_param command /usr/sbin/rpc.mountd -p 32780 -F
  24. procd_close_instance
  25. }
  26. stop_service() {
  27. rpc.nfsd 0 2> /dev/null
  28. /usr/sbin/exportfs -au
  29. grep -q /proc/fs/nfsd /proc/mounts && \
  30. umount /proc/fs/nfsd
  31. }