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.

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