consolefs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. .TH CONSOLEFS 4
  2. .SH NAME
  3. consolefs, C, clog \- file system for console access
  4. .SH SYNOPSIS
  5. .B aux/consolefs
  6. [
  7. .B -m
  8. .I mntpt
  9. ] [
  10. .B -c
  11. .I consoledb
  12. ]
  13. .PP
  14. .B C
  15. .I system
  16. .PP
  17. .B aux/clog
  18. console log
  19. .I system
  20. .SH DESCRIPTION
  21. To ease administration of multiple machines one might attach
  22. many serial console lines to a single computer.
  23. .I Consolefs
  24. is a file system that lets multiple users simultaneously access
  25. these console lines.
  26. The consoles and permissions to access them are defined in the
  27. file
  28. .I consoledb
  29. (default
  30. .BR /lib/ndb/consoledb ).
  31. The format of
  32. .I consoledb
  33. is the same as that of other
  34. .B /lib/ndb
  35. files,
  36. .IR ndb (6).
  37. Consoles are defined by entries of the form:
  38. .PP
  39. .EX
  40. console=dirty dev=/dev/eia205
  41. uid=bignose
  42. gid=support
  43. speed=56200
  44. cronly=
  45. .EE
  46. .PP
  47. Each
  48. .IR console / dev
  49. pair represents the name of a console and the serial line device
  50. associated with it.
  51. .I Consolefs
  52. presents a single level directory with two files
  53. per console:
  54. .I console
  55. and
  56. .IB console ctl\f1.
  57. Writes of
  58. .I console
  59. are equivalent to writes of
  60. .I dev
  61. and reads and writes of
  62. .IB console ctl
  63. are equivalent to reads and writes of
  64. .IB dev ctl\f1.
  65. .I Consolefs
  66. broadcasts anything it reads from
  67. .I dev
  68. to all readers of
  69. .IR console .
  70. Therefore, many users can
  71. .IR con (1)
  72. to a
  73. .IR console ,
  74. see all output, and enter commands.
  75. .PP
  76. The
  77. .I cronly=
  78. attribute causes newlines typed by the user to be sent to
  79. the console as returns.
  80. The
  81. .I speed=x
  82. attribute/value pair specifies a bit rate for the
  83. console. The default is 9600 baud.
  84. .PP
  85. Access to the console is controlled by the
  86. .I uid
  87. and
  88. .I gid
  89. attributes/value pairs.
  90. The uid values are user account names.
  91. The gid values are the names of groups defined in
  92. .I consolefs
  93. by entries of the form:
  94. .PP
  95. .EX
  96. group=support
  97. uid=bob
  98. uid=carol
  99. uid=ted
  100. uid=alice
  101. .EE
  102. .PP
  103. Groups are used to avoid excessive typing. Using
  104. .I gid=x
  105. is equivalent to including a
  106. .I uid=y
  107. for each user
  108. .I y
  109. that is a member of
  110. .IR x .
  111. .PP
  112. To keep users from inadvertently interfering with one another,
  113. notification is broadcast to all readers whenever a user
  114. opens or closes
  115. .IR name .
  116. For example, if user
  117. .B boris
  118. opens a console that users
  119. .B vlad
  120. and
  121. .B barney
  122. have already opened, all will read the message:
  123. .PP
  124. .EX
  125. [+boris, vlad, barney]
  126. .EE
  127. .PP
  128. If
  129. .B vlad
  130. then closes,
  131. .B boris
  132. and
  133. .B barney
  134. will read:
  135. .PP
  136. .EX
  137. [-vlad, boris, barney]
  138. .EE
  139. .PP
  140. .I Consolefs
  141. posts the client end of its 9P channel in
  142. .BR /srv/consolefs
  143. and mounts this locally in
  144. .I mntpt
  145. (default
  146. .BR /mnt/consoles );
  147. remote clients must
  148. .B mount
  149. (see
  150. .IR bind (1))
  151. this file to see the consoles.
  152. .PP
  153. The
  154. .IR rc (1)
  155. script
  156. .B C
  157. automates this procedure.
  158. It uses
  159. .IR import (4)
  160. to connect to
  161. .B /mnt/consoles
  162. on the machine connected to all the consoles, then uses
  163. .IR con (1)
  164. to connect to the console of the machine
  165. .IR system.
  166. The script must be edited at installation
  167. by the local administration to identify the
  168. system that holds
  169. .BR /mnt/consoles .
  170. .PP
  171. .I Aux/clog
  172. opens the file
  173. .I console
  174. and writes every line read from it, prefixed
  175. by the ASCII time to the file
  176. .IR log .
  177. .PP
  178. An example of 2 consoles complete with console logging is:
  179. .IP
  180. .EX
  181. % aux/consolefs
  182. % ls -p /mnt/consoles
  183. bootes
  184. bootesctl
  185. fornax
  186. fornaxctl
  187. % clog /mnt/consoles/fornax /sys/log/fornax &
  188. % clog /mnt/consoles/bootes /sys/log/bootes &
  189. .EE
  190. .SH FILES
  191. .TF /lib/ndb/consoledb
  192. .TP
  193. .B /srv/consoles
  194. Client end of pipe to server.
  195. .TP
  196. .B /mnt/consoles
  197. Default mount point.
  198. .TP
  199. .B /lib/ndb/consoledb
  200. Default user database.
  201. .SH SOURCE
  202. .B /sys/src/cmd/aux/consolefs.c
  203. .br
  204. .B /rc/bin/C
  205. .br
  206. .B /sys/src/cmd/aux/clog.c
  207. .SH BUGS
  208. .PP
  209. Changing the gid's or uid's while
  210. .I consolefs
  211. is running
  212. is detected by
  213. .IR consolefs .
  214. However, to add new consoles
  215. one must restart
  216. .IR consolefs .