listen 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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. .RI [ name ]]
  15. .PP
  16. .B aux/listen1
  17. [
  18. .B -tv
  19. ]
  20. .I addr
  21. .I cmd
  22. [
  23. .I args...
  24. ]
  25. .SH DESCRIPTION
  26. .I listen
  27. announces itself to a network as
  28. .I name
  29. (by default the contents of
  30. .BR /env/sysname )
  31. and listens for inbound calls to local services.
  32. .I Net
  33. is the network protocol on which to listen, by default
  34. .BR /net/il .
  35. The services available are executable files in
  36. .I srvdir
  37. or
  38. .IR trustsrvdir .
  39. If neither
  40. .I srvdir
  41. nor
  42. .I trustsrvdir
  43. is given,
  44. .I listen
  45. looks for executable files in
  46. .BR /bin/service .
  47. Services found in
  48. .I srvdir
  49. are executed as user
  50. .BR none ;
  51. services found in
  52. .I trustsrvdir
  53. as executed as the user who started
  54. .IR listen .
  55. Option
  56. .B -q
  57. suppresses affirmative log information;
  58. option
  59. .B -n
  60. sets an alternate
  61. .I namespace
  62. file (default
  63. .BR /lib/namespace ).
  64. .PP
  65. Service names are made by concatenating the name of
  66. the network with the name of the service or port.
  67. For example,
  68. an inbound call on the TCP network for port 565 executes service
  69. .BR tcp565 .
  70. .PP
  71. The following services are available in
  72. .BR /bin/service .
  73. .TF il17005\ tcp17005
  74. .TP
  75. .B il19 tcp19
  76. .B chargen
  77. service.
  78. .TP
  79. .B il17007 tcp17007
  80. serve a piece of the name space using the Plan 9 file system protocol,
  81. with authentication (typically used by
  82. .IR cpu (1)).
  83. .TP
  84. .B tcp564
  85. like 17007, without authentication (used by Unix
  86. systems to see Plan 9 files).
  87. .TP
  88. .B il17008
  89. like 17007, but serves the root of the tree, forgoing the negotiation for which subtree to serve.
  90. .TP
  91. .B il17009 tcp17009
  92. remote execution.
  93. .TP
  94. .B "il17013 tcp17013"
  95. server for
  96. .IR cpu (1)
  97. command.
  98. .TP
  99. .B il17031
  100. server for
  101. .IR ramfs (4).
  102. .TP
  103. .B il565 tcp565
  104. report the address of the incoming call.
  105. .TP
  106. .B tcp21
  107. FTP daemon
  108. .TP
  109. .B tcp515
  110. LP daemon; see
  111. .IR lp (8).
  112. .TP
  113. .B tcp23
  114. .B telnet
  115. terminal connection.
  116. .TP
  117. .B tcp25
  118. mail delivery.
  119. .TP
  120. .B tcp513
  121. .B rlogin
  122. terminal connection.
  123. .TP
  124. .B il7 tcp7
  125. echo any bytes received (bit mirror)
  126. .TP
  127. .B il9 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. .PD
  147. .PP
  148. The following services are available in
  149. .BR /bin/service.auth .
  150. .TF il565\ tcp565
  151. .TP
  152. .B tcp566
  153. check a SecureNet box.
  154. .TP
  155. .B il566
  156. authentication requests.
  157. .TP
  158. .B tcp993
  159. Secure IMAP4rev1 port.
  160. .PD
  161. .PP
  162. .I Listen1
  163. is a lightweight listener intended for personal use,
  164. modeled from Inferno's
  165. .\" write out this way so automatic programs
  166. .\" don't try to make it into a real man page reference.
  167. \fIlisten\fR(1).
  168. announces on
  169. .IR address ,
  170. running
  171. .I cmd
  172. .I args...
  173. for each incoming connection;
  174. the network directory is passed in the environment
  175. as
  176. .BR $net .
  177. The
  178. .B -t
  179. flag
  180. causes
  181. .I listen1
  182. to run as the invoking user; the default
  183. is to become
  184. .B none
  185. before listening.
  186. The
  187. .B -v
  188. flag causes verbose logging on standard output.
  189. See
  190. .B /rc/bin/tlssrvtunnel
  191. for an example.
  192. .SH FILES
  193. .TF /env/sysname
  194. .TP
  195. .B /net/il
  196. by convention, IL device bind point
  197. .TP
  198. .B /net/tcp
  199. by convention, TCP device bind point
  200. .TP
  201. .B /env/sysname
  202. default announced name
  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)