srv 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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. connects to a remote Unix system via
  185. .IR ssh (1)
  186. and starts
  187. .IR u9fs (4).
  188. The
  189. .B -u
  190. option specifies the path to the
  191. .B u9fs
  192. binary on the remote system.
  193. (By default, an unrooted path of
  194. .B u9fs
  195. is used; if the binary is in the path of
  196. the remote SSH server, you don't need the
  197. .B -u
  198. option.)
  199. For information about the other options,
  200. see the introductory comment in
  201. .BR /rc/bin/srvssh .
  202. The arguments are the same as
  203. .IR srv .
  204. .PP
  205. .I Srvold9p
  206. is a compatibilty hack to allow Fourth Edition Plan 9 systems
  207. to connect to older 9P servers.
  208. It functions as a variant of
  209. .I srv
  210. that performs a version translation on the 9P messages on the underlying connection.
  211. Some of its options are the same as those of
  212. .IR srv ;
  213. the special ones are:
  214. .TP
  215. .B -d
  216. Enable debugging
  217. .TP
  218. .BI -u\ user
  219. When connecting to the remote server, log in as
  220. .IR user .
  221. Since
  222. .I srvold9p
  223. does no authentication, and since new kernels cannot authenticate to
  224. old services, the likeliest value of
  225. .I user
  226. is
  227. .BR none .
  228. .TP
  229. .BI -x\ command
  230. Run
  231. .I command
  232. and use its standard input and output as the 9P service connection.
  233. If the
  234. .I command
  235. string contains blanks, it should be quoted.
  236. .TP
  237. .BI -n\ network-addr
  238. Dial
  239. .I network-addr
  240. to establish the connection.
  241. .TP
  242. .BI -f\ file
  243. Use
  244. .I file
  245. (typically an existing
  246. .IR srv (3)
  247. file) as the connection.
  248. .TP
  249. .B -F
  250. Insert a special (internal) filter process to the connection to maintain
  251. message boundaries; usually only needed on TCP connections.
  252. .TP
  253. .BI -p\ servicename
  254. Post the service under
  255. .IR srv (3)
  256. as
  257. .BI /srv/ servicename\f1.
  258. .PP
  259. .I Srvold9p
  260. is run automatically when a
  261. .IR cpu (1)
  262. call is received on the service port for the old protocol.
  263. .SH EXAMPLES
  264. To see kremvax's and deepthought's files in
  265. .B /n/kremvax
  266. and
  267. .BR /n/deepthought :
  268. .IP
  269. .EX
  270. 9fs kremvax
  271. 9fs hhgttg /n/deepthought
  272. .EE
  273. .PP
  274. To mount as user
  275. .B none
  276. a connection to an older server kgbsun:
  277. .IP
  278. .EX
  279. srvold9p -u none -m /n/kgbsun -p kgbsun -n il!kgbsun
  280. .EE
  281. .PP
  282. Other windows may then mount the connection directly:
  283. .IP
  284. .EX
  285. mount /srv/kgbsun /n/kgbsun
  286. .EE
  287. .PP
  288. To connect to an instance of the Unix server
  289. .IR u9fs (4)
  290. started via
  291. .IR ssh (1):
  292. .IP
  293. .EX
  294. srvssh unix
  295. .EE
  296. .SH NOTE
  297. The TCP port used for 9P is 564.
  298. .SH FILES
  299. .TF /srv/*
  300. .TP
  301. .B /srv/*
  302. ports to file systems and servers posted by
  303. .I srv
  304. and
  305. .I 9fs
  306. .SH SOURCE
  307. .B /sys/src/cmd/srv.c
  308. .br
  309. .B /rc/bin/9fs
  310. .br
  311. .B /rc/bin/srvssh
  312. .br
  313. .SH "SEE ALSO"
  314. .IR bind (1),
  315. .IR dial (2),
  316. .IR srv (3),
  317. .IR ftpfs (4),
  318. .IR u9fs (4)