consolefs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. The
  97. .I openondemand=
  98. attribute causes the console device
  99. .RI ( dev )
  100. to be opened only when the corresponding
  101. .IB mntpt / console
  102. file is open.
  103. .PP
  104. Access to the console is controlled by the
  105. .I uid
  106. and
  107. .I gid
  108. attributes/value pairs.
  109. The uid values are user account names.
  110. The gid values are the names of groups defined in
  111. .I consolefs
  112. by entries of the form:
  113. .PP
  114. .EX
  115. group=support
  116. uid=bob
  117. uid=carol
  118. uid=ted
  119. uid=alice
  120. .EE
  121. .PP
  122. Groups are used to avoid excessive typing. Using
  123. .I gid=x
  124. is equivalent to including a
  125. .I uid=y
  126. for each user
  127. .I y
  128. that is a member of
  129. .IR x .
  130. .PP
  131. To keep users from inadvertently interfering with one another,
  132. notification is broadcast to all readers whenever a user
  133. opens or closes
  134. .IR name .
  135. For example, if user
  136. .B boris
  137. opens a console that users
  138. .B vlad
  139. and
  140. .B barney
  141. have already opened, all will read the message:
  142. .PP
  143. .EX
  144. [+boris, vlad, barney]
  145. .EE
  146. .PP
  147. If
  148. .B vlad
  149. then closes,
  150. .B boris
  151. and
  152. .B barney
  153. will read:
  154. .PP
  155. .EX
  156. [-vlad, boris, barney]
  157. .EE
  158. .PP
  159. .I Consolefs
  160. posts the client end of its 9P channel in
  161. .BR /srv/consolefs
  162. and mounts this locally in
  163. .I mntpt
  164. (default
  165. .BR /mnt/consoles );
  166. remote clients must
  167. .B mount
  168. (see
  169. .IR bind (1))
  170. this file to see the consoles.
  171. .PP
  172. The
  173. .IR rc (1)
  174. script
  175. .B C
  176. automates this procedure.
  177. It uses
  178. .IR import (4)
  179. to connect to
  180. .B /mnt/consoles
  181. on the machine connected to all the consoles, then uses
  182. .IR con (1)
  183. to connect to the console of the machine
  184. .IR system.
  185. The script must be edited at installation
  186. by the local administration to identify the
  187. system that holds
  188. .BR /mnt/consoles .
  189. .PP
  190. .I Aux/clog
  191. opens the file
  192. .I console
  193. and writes every line read from it, prefixed
  194. by the ASCII time to the file
  195. .IR log .
  196. .PP
  197. An example of 2 consoles complete with console logging is:
  198. .IP
  199. .EX
  200. % cat /lib/ndb/consoledb
  201. group=sys
  202. uid=glenda
  203. console=bootes dev=/dev/eia0 gid=sys
  204. console=fornax dev=/dev/eia1 gid=sys
  205. % aux/consolefs
  206. % ls -p /mnt/consoles
  207. bootes
  208. bootesctl
  209. fornax
  210. fornaxctl
  211. % clog /mnt/consoles/fornax /sys/log/fornax &
  212. % clog /mnt/consoles/bootes /sys/log/bootes &
  213. .EE
  214. .PP
  215. The console server's default name space must
  216. mount the consoles for
  217. .I C
  218. to import.
  219. This can be arranged by adding
  220. .IP
  221. .EX
  222. mount /srv/consoles /mnt/consoles
  223. .EE
  224. .LP
  225. to
  226. .BR /lib/namespace.$sysname .
  227. .SH FILES
  228. .TF /lib/ndb/consoledb
  229. .TP
  230. .B /srv/consoles
  231. Client end of pipe to server.
  232. .TP
  233. .B /mnt/consoles
  234. Default mount point.
  235. .TP
  236. .B /lib/ndb/consoledb
  237. Default user database.
  238. .SH SOURCE
  239. .B /sys/src/cmd/aux/consolefs.c
  240. .br
  241. .B /rc/bin/C
  242. .br
  243. .B /sys/src/cmd/aux/clog.c
  244. .SH BUGS
  245. .PP
  246. Changing the gid's or uid's while
  247. .I consolefs
  248. is running
  249. is detected by
  250. .IR consolefs .
  251. However, to add new consoles
  252. one must restart
  253. .IR consolefs .