253 lines · 4.3 KB · Text
RawDownload
.TH CONSOLEFS 4.SH NAMEconsolefs, C, clog  \- file system for console access.SH SYNOPSIS.B aux/consolefs[.B -m.I mntpt] [.B -c.I consoledb].PP.B C.I system.PP.B aux/clogconsole log.I system.SH DESCRIPTIONTo ease administration of multiple machines one might attachmany serial console lines to a single computer..I Consolefsis a file system that lets multiple users simultaneously accessthese console lines.The consoles and permissions to access them are defined in thefile.I consoledb(default.BR /lib/ndb/consoledb ).The format of.I consoledbis the same as that of other.B /lib/ndbfiles,.IR ndb (6).Consoles are defined by entries of the form:.PP.EX	console=dirty dev=/dev/eia205		uid=bignose		gid=support		speed=56200		cronly=.EE.PPEach.IR console / devpair represents the name of a console and the deviceassociated with it..I Consolefspresents a single level directory with up to three filesper console:.IR console ,.IB console ctl\f1,and.IB console stat\f1.Writes of.I consoleare equivalent to writes of.I devand reads and writes of.IB console ctland .IB console statare equivalent to reads and writes of.IB dev ctland.IB dev statrespectively..IB Console ctland.IB console statwill not exist if the underlying.I devdoes not provide them..I Consolefsbroadcasts anything it reads from.I devto all readers of.IR console .Therefore, many users can.IR con (1)to a .IR console ,see all output, and enter commands..PPThe.I cronly=attribute causes newlines typed by the user to be sent tothe console as returns.The.I speed=xattribute/value pair specifies a bit rate for theconsole.  The default is 9600 baud.The.I openondemand=attribute causes the console device.RI ( dev )to be opened only when the corresponding.IB mntpt / consolefile is open..PPAccess to the console is controlled by the.I uidand.I gidattributes/value pairs.The uid values are user account names.The gid values are the names of groups defined in.I consolefsby entries of the form:.PP.EX	group=support		uid=bob		uid=carol		uid=ted		uid=alice.EE.PPGroups are used to avoid excessive typing.  Using.I gid=xis equivalent to including a.I uid=yfor each user.I ythat is a member of.IR x ..PPTo keep users from inadvertently interfering with one another,notification is broadcast to all readers whenever a useropens or closes.IR name .For example, if user.B borisopens a console that users.B vladand.B barneyhave already opened, all will read the message:.PP.EX	[+boris, vlad, barney].EE.PPIf.B vladthen closes,.B borisand .B barneywill read:.PP.EX	[-vlad, boris, barney].EE.PP.I Consolefsposts the client end of its 9P channel in.BR /srv/consolefsand mounts this locally in.I mntpt(default.BR /mnt/consoles );remote clients must.B mount(see.IR bind (1))this file to see the consoles..PPThe.IR rc (1)script.B Cautomates this procedure.It uses.IR import (4)to connect to.B /mnt/consoleson the machine connected to all the consoles, then uses.IR con (1)to connect to the console of the machine.IR system.The script must be edited at installationby the local administration to identify thesystem that holds.BR /mnt/consoles ..PP.I Aux/clogopens the file.I consoleand writes every line read from it, prefixedby the ASCII time to the file.IR log ..PPAn example of 2 consoles complete with console logging is:.IP.EX% cat /lib/ndb/consoledbgroup=sys	uid=glendaconsole=bootes dev=/dev/eia0 gid=sysconsole=fornax dev=/dev/eia1 gid=sys% aux/consolefs% ls -p /mnt/consolesbootesbootesctlfornaxfornaxctl% clog /mnt/consoles/fornax /sys/log/fornax &% clog /mnt/consoles/bootes /sys/log/bootes &.EE.PPThe console server's default name space must mount the consoles for .I Cto import.This can be arranged by adding.IP.EXmount /srv/consoles /mnt/consoles.EE.LPto.BR /lib/namespace.$sysname ..SH FILES.TF /lib/ndb/consoledb.TP.B /srv/consolesClient end of pipe to server..TP.B /mnt/consolesDefault mount point..TP.B /lib/ndb/consoledbDefault user database..SH SOURCE.B /sys/src/cmd/aux/consolefs.c.br.B /rc/bin/C.br.B /sys/src/cmd/aux/clog.c.SH BUGS.PPChanging the gid's or uid's while.I consolefsis runningis detected by.IR consolefs .However, to add new consolesone must restart.IR consolefs .