srv 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. .TH SRV 4
  2. .SH NAME
  3. srv, srvold9p, 9fs, srvssh \- start network file service
  4. .SH SYNOPSIS
  5. .B srv
  6. [
  7. .B -abceCmq
  8. ]
  9. [
  10. .B -s
  11. .I seconds
  12. ]
  13. .RI [ net !] system\c
  14. .RI [! service ]
  15. [
  16. .I srvname
  17. [
  18. .I mtpt
  19. ] ]
  20. .PP
  21. .B srvssh
  22. [
  23. .B -r
  24. ]
  25. [
  26. .B -R
  27. ]
  28. [
  29. .B -s
  30. ]
  31. [
  32. .B -u
  33. .I u9fspath
  34. ]
  35. .I system
  36. [
  37. .I srvname
  38. [
  39. .I mtpt
  40. ] ]
  41. .PP
  42. .B 9fs
  43. .RI [ net !] system
  44. .RI [ mountpoint ]
  45. .PP
  46. .B srvold9p
  47. [
  48. .B -abcCd
  49. ] [
  50. .B -u
  51. .I user
  52. ] [
  53. .B -s
  54. | [
  55. .B -m
  56. .I mountpoint
  57. ] ] [
  58. .B -x
  59. .I command
  60. |
  61. .B -n
  62. .I network-addr
  63. |
  64. .B -f
  65. .I file
  66. ] [
  67. .B -F
  68. ] [
  69. .B -p
  70. .I servicename
  71. ]
  72. .SH DESCRIPTION
  73. .I Srv
  74. dials the given machine and initializes the connection to serve the
  75. 9P protocol.
  76. It then creates in
  77. .B /srv
  78. a file named
  79. .IR srvname .
  80. Users can then
  81. .B mount
  82. (see
  83. .IR bind (1))
  84. the service, typically on a name in
  85. .BR /n ,
  86. to access the files provided by the remote machine.
  87. If
  88. .I srvname
  89. is omitted, the first argument to
  90. .I srv
  91. is used.
  92. Option
  93. .B m
  94. directs
  95. .I srv
  96. to mount the service on
  97. .BI /n/ system
  98. or onto
  99. .I mtpt
  100. if it is given.
  101. Option
  102. .B q
  103. suppresses complaints if the
  104. .B /srv
  105. file already exists.
  106. The
  107. .BR a ,
  108. .BR b ,
  109. .BR c ,
  110. and
  111. .B C
  112. flags are used to control the mount flag as in
  113. .IR bind (1).
  114. The
  115. .B e
  116. flag causes
  117. .I srv
  118. to treat
  119. .I system
  120. as a shell command to be executed rather than
  121. an address to be dialed.
  122. The
  123. .B s
  124. flag causes
  125. .I srv
  126. to sleep for the specified number of seconds
  127. after establishing the connection
  128. before posting and mounting it.
  129. This is sometimes needed by
  130. .IR srvssh .
  131. .PP
  132. The specified
  133. .I service
  134. must serve 9P. Usually
  135. .I service
  136. can be omitted; when calling some
  137. non-Plan 9 systems, a
  138. .I service
  139. such as
  140. .B u9fs
  141. must be mentioned explicitly.
  142. .PP
  143. The
  144. .I 9fs
  145. command does the
  146. .I srv
  147. and the
  148. .I mount
  149. necessary to make available the files of
  150. .I system
  151. on network
  152. .IR net .
  153. The files are mounted on
  154. .IR mountpoint ,
  155. if given;
  156. otherwise they are mounted on
  157. .BI /n/ system\f1.
  158. If
  159. .I system
  160. contains
  161. .L /
  162. characters, only the last element of
  163. .I system
  164. is used in the
  165. .B /n
  166. name.
  167. .PP
  168. .I 9fs
  169. recognizes some special names, such as
  170. .B dump
  171. to make the dump file system available on
  172. .BR /n/dump .
  173. .I 9fs
  174. is an
  175. .IR rc (1)
  176. script; examine it to see what local conventions apply.
  177. .PP
  178. .I Srvssh
  179. is an
  180. .IR rc (1)
  181. connects to a remote Unix system via
  182. .IR ssh (1)
  183. and starts
  184. .IR u9fs (4).
  185. The
  186. .B -u
  187. option specifies the path to the
  188. .B u9fs
  189. binary on the remote system.
  190. (By default, an unrooted path of
  191. .B u9fs
  192. is used; if the binary is in the path of
  193. the remote SSH server, you don't need the
  194. .B -u
  195. option.)
  196. For information about the other options,
  197. see the introductory comment in
  198. .BR /rc/bin/srvssh .
  199. The arguments are the same as
  200. .IR srv .
  201. .PP
  202. .I Srvold9p
  203. is a compatibilty hack to allow Fourth Edition Plan 9 systems
  204. to connect to older 9P servers.
  205. It functions as a variant of
  206. .I srv
  207. that performs a version translation on the 9P messages on the underlying connection.
  208. Some of its options are the same as those of
  209. .IR srv ;
  210. the special ones are:
  211. .TP
  212. .B -d
  213. Enable debugging
  214. .TP
  215. .BI -u\ user
  216. When connecting to the remote server, log in as
  217. .IR user .
  218. Since
  219. .I srvold9p
  220. does no authentication, and since new kernels cannot authenticate to
  221. old services, the likeliest value of
  222. .I user
  223. is
  224. .BR none .
  225. .TP
  226. .BI -x\ command
  227. Run
  228. .I command
  229. and use its standard input and output as the 9P service connection.
  230. If the
  231. .I command
  232. string contains blanks, it should be quoted.
  233. .TP
  234. .BI -n\ network-addr
  235. Dial
  236. .I network-addr
  237. to establish the connection.
  238. .TP
  239. .BI -f\ file
  240. Use
  241. .I file
  242. (typically an existing
  243. .IR srv (3)
  244. file) as the connection.
  245. .TP
  246. .B -F
  247. Insert a special (internal) filter process to the connection to maintain
  248. message boundaries; usually only needed on TCP connections.
  249. .TP
  250. .BI -p\ servicename
  251. Post the service under
  252. .IR srv (3)
  253. as
  254. .BI /srv/ servicename\f1.
  255. .PP
  256. .I Srvold9p
  257. is run automatically when a
  258. .IR cpu (1)
  259. call is received on the service port for the old protocol.
  260. .SH EXAMPLES
  261. To see kremvax's and deepthought's files in
  262. .B /n/kremvax
  263. and
  264. .BR /n/deepthought :
  265. .IP
  266. .EX
  267. 9fs kremvax
  268. 9fs hhgttg /n/deepthought
  269. .EE
  270. .PP
  271. To mount as user
  272. .B none
  273. a connection to an older server kgbsun:
  274. .IP
  275. .EX
  276. srvold9p -u none -m /n/kgbsun -p kgbsun -n il!kgbsun
  277. .EE
  278. .PP
  279. Other windows may then mount the connection directly:
  280. .IP
  281. .EX
  282. mount /srv/kgbsun /n/kgbsun
  283. .EE
  284. .PP
  285. To connect to an instance of the Unix server
  286. .IR u9fs (4)
  287. started via
  288. .IR ssh (1):
  289. .IP
  290. .EX
  291. srvssh unix
  292. .EE
  293. .SH NOTE
  294. The TCP port used for 9P is 564.
  295. .SH FILES
  296. .TF /srv/*
  297. .TP
  298. .B /srv/*
  299. ports to file systems and servers posted by
  300. .I srv
  301. and
  302. .I 9fs
  303. .SH SOURCE
  304. .B /sys/src/cmd/srv.c
  305. .br
  306. .B /rc/bin/9fs
  307. .br
  308. .B /rc/bin/srvssh
  309. .br
  310. .SH "SEE ALSO"
  311. .IR bind (1),
  312. .IR dial (2),
  313. .IR srv (3),
  314. .IR ftpfs (4),
  315. .IR u9fs (4)