CONSOLEFS(4)                                         CONSOLEFS(4)

     NAME
          consolefs, C, clog  - file system for console access

     SYNOPSIS
          aux/consolefs [ -m mntpt ] [ -c consoledb ]

          C [ -dr ] system

          aux/clog console log system

     DESCRIPTION
          To ease administration of multiple machines one might attach
          many serial console lines to a single computer.  Consolefs
          is a file system that lets multiple users simultaneously
          access these console lines.  The consoles and permissions to
          access them are defined in the file consoledb (default
          /lib/ndb/consoledb.sysname), where sysname is the name of
          the system hosting the consoles.  The format of consoledb is
          the same as that of other /lib/ndb files, ndb(6). Consoles
          are defined by entries of the form:

               console=dirty dev=/dev/eia205
                    uid=bignose
                    gid=support
                    speed=56200
                    cronly=

          Each console/dev pair represents the name of a console and
          the device associated with it.  Consolefs presents a single
          level directory with up to three files per console: console,
          consolectl, and consolestat.  Writes of console are equiva-
          lent to writes of dev and reads and writes of consolectl and
          consolestat are equivalent to reads and writes of devctl and
          devstat respectively.  Devices of the form "!prog args" are
          created by invoking the specified prog. Consolectl and
          consolestat will not exist if the underlying dev does not
          provide them.  Consolefs broadcasts anything it reads from
          dev to all readers of console. Therefore, many users can
          con(1) to a console, see all output, and enter commands.

          The cronly= attribute causes newlines typed by the user to
          be sent to the console as returns.  The speed=x
          attribute/value pair specifies a bit rate for the console.
          The default is 9600 baud.  The openondemand= attribute
          causes the console device (dev) to be opened only when the
          corresponding mntpt/console file is open.

          Access to the console is controlled by the uid and gid
          attributes/value pairs.  The uid values are user account
          names.  Using uid=* allows any user.  The gid values are the

     Page 1                       Plan 9            (printed 12/21/24)

     CONSOLEFS(4)                                         CONSOLEFS(4)

          names of groups defined in consolefs by entries of the form:

               group=support
                    uid=bob
                    uid=carol
                    uid=ted
                    uid=alice

          Groups are used to avoid excessive typing.  Using gid=x is
          equivalent to including a uid=y for each user y that is a
          member of x.

          To keep users from inadvertently interfering with one
          another, notification is broadcast to all readers whenever a
          user opens or closes name. For example, if user boris opens
          a console that users vlad and barney have already opened,
          all will read the message:

               [+boris, vlad, barney]

          If vlad then closes, boris and barney will read:

               [-vlad, boris, barney]

          Consolefs posts the client end of its 9P channel in
          /srv/consolefs and mounts this locally in mntpt (default
          /mnt/consoles); remote clients must mount (see bind(1)) this
          file to see the consoles.

          The rc(1) script C automates this procedure.  It uses
          import(4) to connect to /mnt/consoles on the machine con-
          nected to all the consoles.  If -d is not specified, it then
          con(1) to connect to the console of the machine system. If
          -r is specified, carriage return followed by new lines are
          preserved.

          Aux/clog opens the file console and writes every line read
          from it, prefixed by the ASCII time to the file log.

          An example of 2 consoles complete with console logging is:

               % cat /lib/ndb/consoledb
               group=sys
                    uid=glenda
               console=bootes dev=/dev/eia0 gid=sys
               console=fornax dev=/dev/eia1 gid=sys
               % aux/consolefs
               % ls -p /mnt/consoles
               bootes
               bootesctl
               fornax
               fornaxctl

     Page 2                       Plan 9            (printed 12/21/24)

     CONSOLEFS(4)                                         CONSOLEFS(4)

               % clog /mnt/consoles/fornax /sys/log/fornax &
               % clog /mnt/consoles/bootes /sys/log/bootes &

          The console server's default name space must mount the con-
          soles for C to import.  This can be arranged by adding

               mount /srv/consoles /mnt/consoles

          to /lib/namespace or /lib/namespace.$sysname.

     FILES
          /srv/consoles       Client end of pipe to server.
          /mnt/consoles       Default mount point.
          /lib/ndb/consoledb  Default user database.

     SOURCE
          /sys/src/cmd/aux/consolefs.c
          /rc/bin/C
          /sys/src/cmd/aux/clog.c

     BUGS
          C's -r flag means the opposite of con's.

     Page 3                       Plan 9            (printed 12/21/24)