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, 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/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 "tcp17010"
  90. server for
  91. .IR cpu (1)
  92. command.
  93. .TP
  94. .B "il17013 tcp17013"
  95. server for old
  96. .IR cpu (1)
  97. command for compatibility with old clients.
  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 tcp22
  110. .B ssh
  111. `secure shell' encrypted terminal connection or file transfer.
  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 tcp515
  125. LP daemon; see
  126. .IR lp (8).
  127. .TP
  128. .B il7 tcp7
  129. echo any bytes received (bit mirror)
  130. .TP
  131. .B il9 tcp9
  132. consume any bytes received (bit bucket)
  133. .TP
  134. .B tcp53
  135. TCP port for DNS.
  136. .TP
  137. .B tcp110
  138. POP3 port.
  139. .TP
  140. .B tcp143
  141. IMAP4rev1 port.
  142. .TP
  143. .B tcp113
  144. .B Ident
  145. port (always reports
  146. .BR none ).
  147. .TP
  148. .B tcp567
  149. Plan 9 ticket service.
  150. .TP
  151. .B tcp1723
  152. PPTP (point-to-point tunnelling protocol) service.
  153. .PD
  154. .PP
  155. The following services are available in
  156. .BR /bin/service.auth .
  157. .TF il565\ tcp565
  158. .TP
  159. .B tcp566
  160. check a SecureNet box.
  161. .TP
  162. .B il566
  163. authentication requests.
  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)