1
0

exportfs 4.3 KB

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