listen 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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, tcp1723, tcp17007, tcp17008, tcp17009, tcp17010, tcp17013 \- listen for calls on a network device
  4. .SH SYNOPSIS
  5. .B aux/listen
  6. .RB [ -q ]
  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. .PP
  63. Service names are made by concatenating the name of
  64. the network with the name of the service or port.
  65. For example,
  66. an inbound call on the TCP network for port 565 executes service
  67. .BR tcp565 .
  68. .PP
  69. The following services are available in
  70. .BR /bin/service .
  71. .TF \ tcp0000
  72. .TP
  73. .B tcp564
  74. serve a piece of the name space using the Plan 9 file system protocol,
  75. with authentication via
  76. .I Tauth
  77. (in
  78. .IR attach (5)),
  79. no encryption,
  80. and multiplex multiple users on a single connection
  81. (used by
  82. .IR srv (4),
  83. and also by Unix systems to see Plan 9 files).
  84. .TP
  85. .B tcp17007
  86. serve a piece of the name space using the Plan 9 file system protocol,
  87. with authentication at the start,
  88. optional SSL encryption,
  89. and no multiplexing of users
  90. (typically used by
  91. .IR cpu (1)
  92. and
  93. .IR import (4)).
  94. Not usable by user
  95. .IR none .
  96. .TP
  97. .B tcp17008
  98. like
  99. .BR tcp17007 ,
  100. but serves the root of the tree,
  101. forgoing the negotiation for which subtree to serve.
  102. .TP
  103. .B tcp17009
  104. .I rx
  105. remote execution.
  106. .TP
  107. .B tcp17010
  108. server for
  109. .IR cpu (1)
  110. command.
  111. .TP
  112. .B tcp17013
  113. server for old
  114. .IR cpu (1)
  115. command for compatibility with old clients.
  116. .TP
  117. .B tcp7
  118. echo any bytes received (bit mirror)
  119. .TP
  120. .B tcp9
  121. consume any bytes received (bit bucket)
  122. .TP
  123. .B tcp19
  124. .B chargen
  125. service.
  126. .TP
  127. .B tcp21
  128. FTP daemon
  129. .TP
  130. .B tcp22
  131. .IR ssh (1)
  132. `secure shell' encrypted terminal connection or file transfer.
  133. .TP
  134. .B tcp23
  135. .B telnet
  136. terminal connection.
  137. .TP
  138. .B tcp25
  139. mail delivery.
  140. .TP
  141. .B tcp53
  142. TCP port for DNS.
  143. .TP
  144. .B tcp110
  145. POP3 port.
  146. .TP
  147. .B tcp113
  148. .B Ident
  149. port (always reports
  150. .BR none ).
  151. .TP
  152. .B tcp143
  153. IMAP4rev1 port.
  154. .TP
  155. .B tcp513
  156. .B rlogin
  157. terminal connection.
  158. .TP
  159. .B tcp515
  160. LP daemon; see
  161. .IR lp (8).
  162. .TP
  163. .B tcp565
  164. report the address of the incoming call.
  165. .TP
  166. .B tcp567
  167. Plan 9 authentication-ticket service.
  168. .TP
  169. .B tcp1723
  170. PPTP (point-to-point tunnelling protocol) service.
  171. .PD
  172. .PP
  173. The following services are available in
  174. .BR /bin/service.auth .
  175. .TF \ tcp0000
  176. .TP
  177. .B tcp566
  178. validate a SecureNet box.
  179. .TP
  180. .B tcp993
  181. Secure IMAP4rev1 port.
  182. .PD
  183. .PP
  184. .I Listen1
  185. is a lightweight listener intended for personal use,
  186. modeled from Inferno's
  187. .\" write out this way so automatic programs
  188. .\" don't try to make it into a real man page reference.
  189. \fIlisten\fR(1).
  190. announces on
  191. .IR address ,
  192. running
  193. .I cmd
  194. .I args...
  195. for each incoming connection;
  196. the network directory is passed in the environment
  197. as
  198. .BR $net .
  199. Option
  200. .B -t
  201. causes
  202. .I listen1
  203. to run as the invoking user; the default
  204. is to become
  205. .B none
  206. before listening.
  207. Option
  208. .B -v
  209. causes verbose logging on standard output.
  210. See
  211. .B /rc/bin/tlssrvtunnel
  212. for an example.
  213. .SH FILES
  214. .TF /env/sysname
  215. .TP
  216. .B /net/tcp
  217. by convention, TCP device bind point
  218. .SH SOURCE
  219. The sources to
  220. .I listen
  221. and
  222. .I listen1
  223. are
  224. .B /sys/src/cmd/aux/listen.c
  225. and
  226. .BR /sys/src/cmd/aux/listen1.c .
  227. The other commands are
  228. .IR rc (1)
  229. scripts in
  230. .BR /rc/bin/service .
  231. .SH "SEE ALSO"
  232. .IR authsrv (6),
  233. .IR dial (2)