listen 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. .TH LISTEN 8
  2. .SH NAME
  3. listen, listen1, il7, il9, il19, il565, il566, il17007, il17008, il17009, il17013, il17031, tcp7, tcp9, tcp19, tcp21, tcp23, tcp25, tcp53, tcp110, tcp113, tcp143, tcp513, tcp515, tcp564, tcp565, tcp566, tcp567, tcp993, tcp17007, tcp17009, 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/il .
  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 il17005\ tcp17005
  69. .TP
  70. .B il19 tcp19
  71. .B chargen
  72. service.
  73. .TP
  74. .B il17007 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 il17009 tcp17009
  87. remote execution.
  88. .TP
  89. .B "il17013 tcp17013"
  90. server for
  91. .IR cpu (1)
  92. command.
  93. .TP
  94. .B il17031
  95. server for
  96. .IR ramfs (4).
  97. .TP
  98. .B il565 tcp565
  99. report the address of the incoming call.
  100. .TP
  101. .B tcp21
  102. FTP daemon
  103. .TP
  104. .B tcp515
  105. LP daemon; see
  106. .IR lp (8).
  107. .TP
  108. .B tcp23
  109. .B telnet
  110. terminal connection.
  111. .TP
  112. .B tcp25
  113. mail delivery.
  114. .TP
  115. .B tcp513
  116. .B rlogin
  117. terminal connection.
  118. .TP
  119. .B il7 tcp7
  120. echo any bytes received (bit mirror)
  121. .TP
  122. .B il9 tcp9
  123. consume any bytes received (bit bucket)
  124. .TP
  125. .B tcp53
  126. TCP port for DNS.
  127. .TP
  128. .B tcp110
  129. POP3 port.
  130. .TP
  131. .B tcp143
  132. IMAP4rev1 port.
  133. .TP
  134. .B tcp113
  135. .B Ident
  136. port (always reports
  137. .BR none ).
  138. .TP
  139. .B tcp567
  140. Plan 9 ticket service.
  141. .PD
  142. .PP
  143. The following services are available in
  144. .BR /bin/service.auth .
  145. .TF il565\ tcp565
  146. .TP
  147. .B tcp566
  148. check a SecureNet box.
  149. .TP
  150. .B il566
  151. authentication requests.
  152. .TP
  153. .B tcp993
  154. Secure IMAP4rev1 port.
  155. .PD
  156. .PP
  157. .I Listen1
  158. is a lightweight listener intended for personal use,
  159. modeled from Inferno's
  160. .\" write out this way so automatic programs
  161. .\" don't try to make it into a real man page reference.
  162. \fIlisten\fR(1).
  163. announces on
  164. .IR address ,
  165. running
  166. .I cmd
  167. .I args...
  168. for each incoming connection;
  169. the network directory is passed in the environment
  170. as
  171. .BR $net .
  172. Option
  173. .B -t
  174. causes
  175. .I listen1
  176. to run as the invoking user; the default
  177. is to become
  178. .B none
  179. before listening.
  180. Option
  181. .B -v
  182. causes verbose logging on standard output.
  183. See
  184. .B /rc/bin/tlssrvtunnel
  185. for an example.
  186. .SH FILES
  187. .TF /env/sysname
  188. .TP
  189. .B /net/tcp
  190. by convention, TCP device bind point
  191. .SH SOURCE
  192. The sources to
  193. .I listen
  194. and
  195. .I listen1
  196. are
  197. .B /sys/src/cmd/aux/listen.c
  198. and
  199. .BR /sys/src/cmd/aux/listen1.c .
  200. The other commands are
  201. .IR rc (1)
  202. scripts in
  203. .BR /rc/bin/service .
  204. .SH "SEE ALSO"
  205. .IR authsrv (6),
  206. .IR dial (2)