listen 3.6 KB

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