srv 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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. .TF "-u userxx"
  216. .PD
  217. .TP
  218. .B -d
  219. Enable debugging
  220. .TP
  221. .BI -u\ user
  222. When connecting to the remote server, log in as
  223. .IR user .
  224. Since
  225. .I srvold9p
  226. does no authentication, and since new kernels cannot authenticate to
  227. old services, the likeliest value of
  228. .I user
  229. is
  230. .BR none .
  231. .TP
  232. .BI -x\ command
  233. Run
  234. .I command
  235. and use its standard input and output as the 9P service connection.
  236. If the
  237. .I command
  238. string contains blanks, it should be quoted.
  239. .TP
  240. .BI -n\ network-addr
  241. Dial
  242. .I network-addr
  243. to establish the connection.
  244. .TP
  245. .BI -f\ file
  246. Use
  247. .I file
  248. (typically an existing
  249. .IR srv (3)
  250. file) as the connection.
  251. .TP
  252. .B -F
  253. Insert a special (internal) filter process to the connection to maintain
  254. message boundaries; usually only needed on TCP connections.
  255. .TP
  256. .BI -p\ servicename
  257. Post the service under
  258. .IR srv (3)
  259. as
  260. .BI /srv/ servicename\f1.
  261. .PP
  262. .I Srvold9p
  263. is run automatically when a
  264. .IR cpu (1)
  265. call is received on the service port for the old protocol.
  266. .SH EXAMPLES
  267. To see kremvax's and deepthought's files in
  268. .B /n/kremvax
  269. and
  270. .BR /n/deepthought :
  271. .IP
  272. .EX
  273. 9fs kremvax
  274. 9fs hhgttg /n/deepthought
  275. .EE
  276. .PP
  277. To mount as user
  278. .B none
  279. a connection to an older server kgbsun:
  280. .IP
  281. .EX
  282. srvold9p -u none -m /n/kgbsun -p kgbsun -n il!kgbsun
  283. .EE
  284. .PP
  285. Other windows may then mount the connection directly:
  286. .IP
  287. .EX
  288. mount /srv/kgbsun /n/kgbsun
  289. .EE
  290. .PP
  291. To connect to an instance of the Unix server
  292. .IR u9fs (4)
  293. started via
  294. .IR ssh (1):
  295. .IP
  296. .EX
  297. srvssh unix
  298. .EE
  299. .SH NOTE
  300. The TCP port used for 9P is 564.
  301. .SH FILES
  302. .TF /srv/*
  303. .TP
  304. .B /srv/*
  305. ports to file systems and servers posted by
  306. .I srv
  307. and
  308. .I 9fs
  309. .SH SOURCE
  310. .B /sys/src/cmd/srv.c
  311. .br
  312. .B /rc/bin/9fs
  313. .br
  314. .B /rc/bin/srvssh
  315. .br
  316. .B /sys/src/cmd/srvold9p
  317. .SH "SEE ALSO"
  318. .IR bind (1),
  319. .IR dial (2),
  320. .IR srv (3),
  321. .IR exportfs (4),
  322. .IR import (4),
  323. .IR ftpfs (4),
  324. .IR u9fs (4)