listen 3.6 KB

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