exportfs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. .TH EXPORTFS 4
  2. .SH NAME
  3. exportfs, srvfs \- network file server plumbing
  4. .SH SYNOPSIS
  5. .B exportfs
  6. [
  7. .B -ads
  8. ] [
  9. .B -f
  10. .I dbgfile
  11. ] [
  12. .B -m
  13. .I msize
  14. ] [
  15. .B -r
  16. .I root
  17. ] [
  18. .B -S
  19. .I service
  20. ] [
  21. .B -A announce
  22. ]
  23. .PP
  24. .B srvfs
  25. [
  26. .B -d
  27. ]
  28. [
  29. .B -e
  30. .I "'enc auth'"
  31. ]
  32. [
  33. .B -p
  34. .I filter
  35. ]
  36. .I name
  37. .I path
  38. .SH DESCRIPTION
  39. .I Exportfs
  40. is a user level file server that allows Plan 9 compute servers, rather
  41. than file servers, to export portions of a name space across networks.
  42. The service is started either by the
  43. .IR cpu (1)
  44. command or by a network listener process. An initial protocol
  45. establishes a root directory for the exported name space.
  46. The
  47. connection to
  48. .I exportfs
  49. is then mounted, typically on
  50. .BR /mnt/term .
  51. .I Exportfs
  52. then acts as a relay file server: operations in the imported file
  53. tree are executed on the remote server and the results returned. This
  54. gives the appearance of exporting a name space from a remote machine
  55. into a local file tree.
  56. .PP
  57. The
  58. .B -r
  59. option bypasses the initial protocol, instead immediately
  60. serving the name space rooted at
  61. .IR root .
  62. The
  63. .B -s
  64. option is equivalent to
  65. .B -r
  66. .BR / ,
  67. but predates
  68. .B -r
  69. and remains for compatibility.
  70. .PP
  71. The
  72. .B -S
  73. option also bypasses the initial protocol but
  74. serves the result of mounting
  75. .IR service .
  76. A separate mount is used for each
  77. .IR attach (5)
  78. message,
  79. to correctly handle servers in which each mount
  80. corresponds to a different client
  81. .IR e.g. , (
  82. .IR rio (4)).
  83. .PP
  84. The
  85. .B -m
  86. option sets the maximum message size that
  87. exportfs should offer to send (see
  88. .IR version (5));
  89. this helps tunneled
  90. 9P connections to avoid unnecessary fragmentation.
  91. .PP
  92. The
  93. .B -a
  94. option instructs
  95. .I exportfs
  96. to authenticate the user, usually because it is
  97. being invoked from a remote machine.
  98. .PP
  99. The
  100. .B -d
  101. option instructs
  102. .I exportfs
  103. to log all 9P traffic to
  104. .I dbgfile
  105. (default
  106. .BR /tmp/exportdb ).
  107. .PP
  108. The
  109. .B -e
  110. option specifies the encryption and authentication algorithms to use for
  111. encrypting the wire traffic. The defaults are
  112. .B rc4_256
  113. and
  114. .BR sha1 .
  115. The full list of supported protocols in in
  116. .IR ssl (3).
  117. .PP
  118. The
  119. .B cpu
  120. command uses
  121. .I exportfs
  122. to serve device files in the terminal. The
  123. .IR import (4)
  124. command calls
  125. .I exportfs
  126. on a remote machine, permitting users to access arbitrary pieces of
  127. name space on other systems.
  128. Because the kernel disallows reads and writes on mounted pipes
  129. (as might be found in
  130. .BR /srv ),
  131. .I exportfs
  132. calls itself (with appropriate
  133. .B -m
  134. and
  135. .B -S
  136. options) to simulate reads and writes on such files.
  137. .PP
  138. .I Srvfs
  139. invokes
  140. .I exportprog
  141. (default
  142. .BR /bin/exportfs )
  143. to create a mountable file system from a name space
  144. and posts it at
  145. .BI /srv/ name ,
  146. which is created with mode
  147. .I perm
  148. (default 0600).
  149. By default, the name space is the directory tree rooted at
  150. .IR path .
  151. If the
  152. .B -S
  153. option is given, the name space is obtained by
  154. mounting
  155. .B path
  156. (typically a file in
  157. .BR /srv ).
  158. If the
  159. .B -d
  160. option is given,
  161. .I srvfs
  162. passes it to
  163. .I exportprog
  164. to enable debugging.
  165. .PP
  166. The
  167. .B -A
  168. filter specifies an announce string when exportfs is used in combination
  169. with aan. The announce string identifies the network and network
  170. protocol to use for aan connections.
  171. .SH EXAMPLES
  172. Use
  173. .I srvfs
  174. to enable mounting of an FTP file system (see
  175. .IR ftpfs (4))
  176. in several windows,
  177. or to publish a
  178. .B /proc
  179. (see
  180. .IR proc (3))
  181. with a broken process so a remote person may debug the program:
  182. .IP
  183. .EX
  184. srvfs ftp /n/ftp
  185. srvfs broke /mnt/term/proc
  186. .EE
  187. .LP
  188. Use
  189. .I srvfs
  190. to obtain a copy of a service to be manipulated directly
  191. by a user program like
  192. .IR nfsserver (8):
  193. .IP
  194. .EX
  195. srvfs nfs.boot /srv/boot
  196. aux/nfsserver -f /srv/nfs.boot
  197. .EE
  198. .SH SOURCE
  199. .B /sys/src/cmd/exportfs
  200. .br
  201. .B /sys/src/cmd/srvfs.c
  202. .SH SEE ALSO
  203. .IR aan (1),
  204. .IR import (4),
  205. .IR exportfs (4)