srv 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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 -abceCmnq
  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. .BR C ,
  111. and
  112. .B n
  113. flags are used to control the mount flag as in
  114. .I mount
  115. (see
  116. .IR bind (1)).
  117. The
  118. .B e
  119. flag causes
  120. .I srv
  121. to treat
  122. .I system
  123. as a shell command to be executed rather than
  124. an address to be dialed.
  125. The
  126. .B s
  127. flag causes
  128. .I srv
  129. to sleep for the specified number of seconds
  130. after establishing the connection
  131. before posting and mounting it.
  132. This is sometimes needed by
  133. .IR srvssh .
  134. .PP
  135. The specified
  136. .I service
  137. must serve 9P. Usually
  138. .I service
  139. can be omitted; when calling some
  140. non-Plan 9 systems, a
  141. .I service
  142. such as
  143. .B u9fs
  144. must be mentioned explicitly.
  145. .PP
  146. The
  147. .I 9fs
  148. command does the
  149. .I srv
  150. and the
  151. .I mount
  152. necessary to make available the files of
  153. .I system
  154. on network
  155. .IR net .
  156. The files are mounted on
  157. .IR mountpoint ,
  158. if given;
  159. otherwise they are mounted on
  160. .BI /n/ system\f1.
  161. If
  162. .I system
  163. contains
  164. .L /
  165. characters, only the last element of
  166. .I system
  167. is used in the
  168. .B /n
  169. name.
  170. .PP
  171. .I 9fs
  172. recognizes some special names, such as
  173. .B dump
  174. to make the dump file system available on
  175. .BR /n/dump .
  176. .I 9fs
  177. is an
  178. .IR rc (1)
  179. script; examine it to see what local conventions apply.
  180. .PP
  181. .I Srvssh
  182. is an
  183. .IR rc (1)
  184. command that
  185. connects to a remote Unix system via
  186. .IR ssh (1)
  187. and starts
  188. .IR u9fs (4).
  189. The
  190. .B -u
  191. option specifies the path to the
  192. .B u9fs
  193. binary on the remote system.
  194. (By default, an unrooted path of
  195. .B u9fs
  196. is used; if the binary is in the path of
  197. the remote SSH server, you don't need the
  198. .B -u
  199. option.)
  200. For information about the other options,
  201. see the introductory comment in
  202. .BR /rc/bin/srvssh .
  203. The arguments are the same as
  204. .IR srv .
  205. .PP
  206. .I Srvold9p
  207. is a compatibilty hack to allow Fourth Edition Plan 9 systems
  208. to connect to older 9P servers.
  209. It functions as a variant of
  210. .I srv
  211. that performs a version translation on the 9P messages on the underlying connection.
  212. Some of its options are the same as those of
  213. .IR srv ;
  214. the special ones are:
  215. .TP
  216. .B -d
  217. Enable debugging
  218. .TP
  219. .BI -u\ user
  220. When connecting to the remote server, log in as
  221. .IR user .
  222. Since
  223. .I srvold9p
  224. does no authentication, and since new kernels cannot authenticate to
  225. old services, the likeliest value of
  226. .I user
  227. is
  228. .BR none .
  229. .TP
  230. .BI -x\ command
  231. Run
  232. .I command
  233. and use its standard input and output as the 9P service connection.
  234. If the
  235. .I command
  236. string contains blanks, it should be quoted.
  237. .TP
  238. .BI -n\ network-addr
  239. Dial
  240. .I network-addr
  241. to establish the connection.
  242. .TP
  243. .BI -f\ file
  244. Use
  245. .I file
  246. (typically an existing
  247. .IR srv (3)
  248. file) as the connection.
  249. .TP
  250. .B -F
  251. Insert a special (internal) filter process to the connection to maintain
  252. message boundaries; usually only needed on TCP connections.
  253. .TP
  254. .BI -p\ servicename
  255. Post the service under
  256. .IR srv (3)
  257. as
  258. .BI /srv/ servicename\f1.
  259. .PP
  260. .I Srvold9p
  261. is run automatically when a
  262. .IR cpu (1)
  263. call is received on the service port for the old protocol.
  264. .SH EXAMPLES
  265. To see kremvax's and deepthought's files in
  266. .B /n/kremvax
  267. and
  268. .BR /n/deepthought :
  269. .IP
  270. .EX
  271. 9fs kremvax
  272. 9fs hhgttg /n/deepthought
  273. .EE
  274. .PP
  275. To mount as user
  276. .B none
  277. a connection to an older server kgbsun:
  278. .IP
  279. .EX
  280. srvold9p -u none -m /n/kgbsun -p kgbsun -n il!kgbsun
  281. .EE
  282. .PP
  283. Other windows may then mount the connection directly:
  284. .IP
  285. .EX
  286. mount /srv/kgbsun /n/kgbsun
  287. .EE
  288. .PP
  289. To connect to an instance of the Unix server
  290. .IR u9fs (4)
  291. started via
  292. .IR ssh (1):
  293. .IP
  294. .EX
  295. srvssh unix
  296. .EE
  297. .SH NOTE
  298. The TCP port used for 9P is 564.
  299. .SH FILES
  300. .TF /srv/*
  301. .TP
  302. .B /srv/*
  303. ports to file systems and servers posted by
  304. .I srv
  305. and
  306. .I 9fs
  307. .SH SOURCE
  308. .B /sys/src/cmd/srv.c
  309. .br
  310. .B /rc/bin/9fs
  311. .br
  312. .B /rc/bin/srvssh
  313. .br
  314. .SH "SEE ALSO"
  315. .IR bind (1),
  316. .IR dial (2),
  317. .IR srv (3),
  318. .IR ftpfs (4),
  319. .IR u9fs (4)