network 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/rc
  2. s=/n/dist/dist/replica
  3. serverroot=/n/dist
  4. serverlog=$s/plan9.log
  5. serverproto=$s/plan9.proto
  6. fn servermount {
  7. 9fs sources
  8. bind /n/sources/plan9 /n/dist
  9. }
  10. fn serverupdate { status='' }
  11. fn clientmount {
  12. unmount /n/boot >[2]/dev/null
  13. if(test -e /srv/fscons){
  14. if(! test -e /srv/replica){
  15. echo 'srv -AWP replica' >>/srv/fscons >[2]/dev/null ||
  16. echo 'warning: could not write to /srv/fscons' >[1=2]
  17. }
  18. if(! mount -c /srv/replica /n/boot)
  19. echo 'warning: cannot mount /srv/replica' >[1=2]
  20. status=''
  21. }
  22. if not if(test -e /srv/kfs){
  23. mount -c /srv/kfs /n/boot
  24. status=''
  25. }
  26. if(! test -d /n/boot/dist/replica){
  27. echo 'warning: could not mount /srv/replica or /srv/kfs; using /srv/boot' >[1=2]
  28. mount -c /srv/boot /n/boot
  29. }
  30. if(! test -d /n/boot/dist/replica){
  31. echo 'could not mount client root' >[1=2]
  32. exit 'no /dist/replica'
  33. }
  34. status=''
  35. }
  36. c=/n/boot/dist/replica
  37. clientroot=/n/boot
  38. clientdb=$c/client/plan9.db
  39. clientexclude=(dist/replica/client)
  40. clientlog=$c/client/plan9.log
  41. clientproto=$c/plan9.proto
  42. applyopt=(-u -T$c/client/plan9.time)