consolefs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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 device
  50. associated with it.
  51. .I Consolefs
  52. presents a single level directory with up to three files
  53. per console:
  54. .IR console ,
  55. .IB console ctl\f1,
  56. and
  57. .IB console stat\f1.
  58. Writes of
  59. .I console
  60. are equivalent to writes of
  61. .I dev
  62. and reads and writes of
  63. .IB console ctl
  64. and
  65. .IB console stat
  66. are equivalent to reads and writes of
  67. .IB dev ctl
  68. and
  69. .IB dev stat
  70. respectively.
  71. .IB Console ctl
  72. and
  73. .IB console stat
  74. will not exist if the underlying
  75. .I dev
  76. does not provide them.
  77. .I Consolefs
  78. broadcasts anything it reads from
  79. .I dev
  80. to all readers of
  81. .IR console .
  82. Therefore, many users can
  83. .IR con (1)
  84. to a
  85. .IR console ,
  86. see all output, and enter commands.
  87. .PP
  88. The
  89. .I cronly=
  90. attribute causes newlines typed by the user to be sent to
  91. the console as returns.
  92. The
  93. .I speed=x
  94. attribute/value pair specifies a bit rate for the
  95. console. The default is 9600 baud.
  96. .PP
  97. Access to the console is controlled by the
  98. .I uid
  99. and
  100. .I gid
  101. attributes/value pairs.
  102. The uid values are user account names.
  103. The gid values are the names of groups defined in
  104. .I consolefs
  105. by entries of the form:
  106. .PP
  107. .EX
  108. group=support
  109. uid=bob
  110. uid=carol
  111. uid=ted
  112. uid=alice
  113. .EE
  114. .PP
  115. Groups are used to avoid excessive typing. Using
  116. .I gid=x
  117. is equivalent to including a
  118. .I uid=y
  119. for each user
  120. .I y
  121. that is a member of
  122. .IR x .
  123. .PP
  124. To keep users from inadvertently interfering with one another,
  125. notification is broadcast to all readers whenever a user
  126. opens or closes
  127. .IR name .
  128. For example, if user
  129. .B boris
  130. opens a console that users
  131. .B vlad
  132. and
  133. .B barney
  134. have already opened, all will read the message:
  135. .PP
  136. .EX
  137. [+boris, vlad, barney]
  138. .EE
  139. .PP
  140. If
  141. .B vlad
  142. then closes,
  143. .B boris
  144. and
  145. .B barney
  146. will read:
  147. .PP
  148. .EX
  149. [-vlad, boris, barney]
  150. .EE
  151. .PP
  152. .I Consolefs
  153. posts the client end of its 9P channel in
  154. .BR /srv/consolefs
  155. and mounts this locally in
  156. .I mntpt
  157. (default
  158. .BR /mnt/consoles );
  159. remote clients must
  160. .B mount
  161. (see
  162. .IR bind (1))
  163. this file to see the consoles.
  164. .PP
  165. The
  166. .IR rc (1)
  167. script
  168. .B C
  169. automates this procedure.
  170. It uses
  171. .IR import (4)
  172. to connect to
  173. .B /mnt/consoles
  174. on the machine connected to all the consoles, then uses
  175. .IR con (1)
  176. to connect to the console of the machine
  177. .IR system.
  178. The script must be edited at installation
  179. by the local administration to identify the
  180. system that holds
  181. .BR /mnt/consoles .
  182. .PP
  183. .I Aux/clog
  184. opens the file
  185. .I console
  186. and writes every line read from it, prefixed
  187. by the ASCII time to the file
  188. .IR log .
  189. .PP
  190. An example of 2 consoles complete with console logging is:
  191. .IP
  192. .EX
  193. % cat /lib/ndb/consoledb
  194. group=sys
  195. uid=glenda
  196. console=bootes dev=/dev/eia0 gid=sys
  197. console=fornax dev=/dev/eia1 gid=sys
  198. % aux/consolefs
  199. % ls -p /mnt/consoles
  200. bootes
  201. bootesctl
  202. fornax
  203. fornaxctl
  204. % clog /mnt/consoles/fornax /sys/log/fornax &
  205. % clog /mnt/consoles/bootes /sys/log/bootes &
  206. .EE
  207. .PP
  208. The console server's default name space must
  209. mount the consoles for
  210. .I C
  211. to import.
  212. This can be arranged by adding
  213. .IP
  214. .EX
  215. mount /srv/consoles /mnt/consoles
  216. .EE
  217. .LP
  218. to
  219. .BR /lib/namespace.$sysname .
  220. .SH FILES
  221. .TF /lib/ndb/consoledb
  222. .TP
  223. .B /srv/consoles
  224. Client end of pipe to server.
  225. .TP
  226. .B /mnt/consoles
  227. Default mount point.
  228. .TP
  229. .B /lib/ndb/consoledb
  230. Default user database.
  231. .SH SOURCE
  232. .B /sys/src/cmd/aux/consolefs.c
  233. .br
  234. .B /rc/bin/C
  235. .br
  236. .B /sys/src/cmd/aux/clog.c
  237. .SH BUGS
  238. .PP
  239. Changing the gid's or uid's while
  240. .I consolefs
  241. is running
  242. is detected by
  243. .IR consolefs .
  244. However, to add new consoles
  245. one must restart
  246. .IR consolefs .