listen 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. .TH LISTEN 8
  2. .SH NAME
  3. listen, listen1, tcp7, tcp9, tcp19, tcp21, tcp22, tcp23, tcp25, tcp53, tcp110, tcp113, tcp143, tcp513, tcp515, tcp564, tcp565, tcp566, tcp567, tcp993, tcp995, tcp1723, tcp17007, tcp17008, tcp17009, tcp17010, tcp17013 \- listen for calls on a network device
  4. .SH SYNOPSIS
  5. .B aux/listen
  6. .RB [ -iq ]
  7. .RB [ -d
  8. .IR srvdir ]
  9. .RB [ -t
  10. .IR trustsrvdir ]
  11. .RB [ -n
  12. .IR namespace ]
  13. .RI [ net ]
  14. .PP
  15. .B aux/listen1
  16. [
  17. .B -tv
  18. ]
  19. .I addr
  20. .I cmd
  21. [
  22. .I args...
  23. ]
  24. .SH DESCRIPTION
  25. .I listen
  26. listens on a network for inbound calls to local services.
  27. .I Net
  28. is the network protocol on which to listen, by default
  29. .BR /net/tcp .
  30. The services available are executable, non-empty files in
  31. .I srvdir
  32. or
  33. .IR trustsrvdir .
  34. If neither
  35. .I srvdir
  36. nor
  37. .I trustsrvdir
  38. is given,
  39. .I listen
  40. looks for executable files in
  41. .BR /bin/service .
  42. Services found in
  43. .I srvdir
  44. are executed as user
  45. .BR none ;
  46. services found in
  47. .I trustsrvdir
  48. are executed as the user who started
  49. .IR listen .
  50. When changing user to
  51. .BR none ,
  52. a new namespace is created,
  53. usually by executing
  54. .BR /lib/namespace ,
  55. but
  56. .B -n
  57. selects an alternate
  58. .IR namespace .
  59. Option
  60. .B -q
  61. suppresses affirmative log information.
  62. Option
  63. .B -i
  64. suppresses the periodic scan of the service directories for changes.
  65. .PP
  66. Service names are made by concatenating the name of
  67. the network with the name of the service or port.
  68. For example,
  69. an inbound call on the TCP network for port 565 executes service
  70. .BR tcp565 .
  71. These programs are
  72. .IR exec ed
  73. with arguments consisting of
  74. service
  75. (e.g.,
  76. .LR tcp25 ),
  77. protocol
  78. (e.g.,
  79. .LR tcp ),
  80. and the directory of this network connection,
  81. with the network connection's
  82. .B data
  83. file bound to
  84. .B /dev/cons
  85. and opened read/write as file descriptors 0, 1 and 2.
  86. .PP
  87. At least the following services are available in
  88. .BR /bin/service .
  89. .TF \ tcp0000
  90. .TP
  91. .B tcp564
  92. serve a piece of the name space using the Plan 9 file system protocol,
  93. with authentication via
  94. .I Tauth
  95. (in
  96. .IR attach (5)),
  97. no encryption,
  98. and multiplex multiple users on a single connection
  99. (used by
  100. .IR srv (4),
  101. and also by Unix systems to see Plan 9 files).
  102. .TP
  103. .B tcp17007
  104. serve a piece of the name space using the Plan 9 file system protocol,
  105. with authentication at the start,
  106. optional SSL encryption,
  107. and no multiplexing of users
  108. (typically used by
  109. .IR cpu (1)
  110. and
  111. .IR import (4)).
  112. Not usable by user
  113. .IR none .
  114. .TP
  115. .B tcp17008
  116. like
  117. .BR tcp17007 ,
  118. but serves the root of the tree,
  119. forgoing the negotiation for which subtree to serve.
  120. .TP
  121. .B tcp17009
  122. .I rx
  123. remote execution.
  124. .TP
  125. .B tcp17010
  126. server for
  127. .IR cpu (1)
  128. command.
  129. .TP
  130. .B tcp17013
  131. server for old
  132. .IR cpu (1)
  133. command for compatibility with old clients.
  134. .TP
  135. .B tcp7
  136. echo any bytes received (bit mirror)
  137. .TP
  138. .B tcp9
  139. consume any bytes received (bit bucket)
  140. .TP
  141. .B tcp19
  142. .B chargen
  143. service.
  144. .TP
  145. .B tcp21
  146. FTP daemon
  147. .TP
  148. .B tcp22
  149. .IR ssh (1)
  150. `secure shell' encrypted terminal connection or file transfer.
  151. .TP
  152. .B tcp23
  153. .B telnet
  154. terminal connection.
  155. .TP
  156. .B tcp25
  157. mail delivery.
  158. .TP
  159. .B tcp53
  160. TCP port for DNS.
  161. .TP
  162. .B tcp110
  163. POP3 port.
  164. .TP
  165. .B tcp113
  166. .B Ident
  167. port (always reports
  168. .BR none ).
  169. .TP
  170. .B tcp143
  171. IMAP4rev1 port.
  172. .TP
  173. .B tcp513
  174. .B rlogin
  175. terminal connection.
  176. .TP
  177. .B tcp515
  178. LP daemon; see
  179. .IR lp (8).
  180. .TP
  181. .B tcp565
  182. report the address of the incoming call.
  183. .TP
  184. .B tcp993
  185. Secure IMAP4rev1 port.
  186. .TP
  187. .B tcp995
  188. Secure POP3 port.
  189. .TP
  190. .B tcp1723
  191. PPTP (point-to-point tunnelling protocol) service.
  192. .PD
  193. .PP
  194. At least the following services are available in
  195. .BR /bin/service.auth ,
  196. the usual
  197. .IR trustsrvdir .
  198. .TF \ tcp0000
  199. .TP
  200. .B tcp566
  201. validate a SecureNet box.
  202. .TP
  203. .B tcp567
  204. Plan 9 authentication-ticket service.
  205. .PD
  206. .PP
  207. .I Listen1
  208. is a lightweight listener intended for personal use,
  209. modeled from Inferno's
  210. .\" write out this way so automatic programs
  211. .\" don't try to make it into a real man page reference.
  212. \fIlisten\fR(1).
  213. .I Listen1
  214. announces on
  215. .IR address ,
  216. running
  217. .I cmd
  218. .I args...
  219. for each incoming connection;
  220. the network directory is passed in the environment
  221. as
  222. .BR $net .
  223. Option
  224. .B -t
  225. causes
  226. .I listen1
  227. to run as the invoking user; the default
  228. is to become
  229. .B none
  230. before listening.
  231. Option
  232. .B -v
  233. causes verbose logging on standard output.
  234. See
  235. .B /rc/bin/tlssrvtunnel
  236. for an example.
  237. .SH FILES
  238. .TF /env/sysname
  239. .TP
  240. .B /net/tcp
  241. by convention, TCP device bind point
  242. .SH SOURCE
  243. .B /sys/src/cmd/aux/listen*.c
  244. .br
  245. .B /rc/bin/service*
  246. .SH "SEE ALSO"
  247. .IR authsrv (6),
  248. .IR dial (2)
  249. .SH BUGS
  250. .IR Srvdir ,
  251. .IR trustsrvdir
  252. and
  253. .I namespace
  254. must all be absolute path names.