123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978 |
- .TH FOSSILCONS 8
- .SH NAME
- fossilcons \- fossil console commands
- .SH SYNOPSIS
- .B
- con /srv/fscons
- .PP
- .PD 0.1
- .B .
- .I file
- .PP
- .B 9p
- .I T-message
- ...
- .PP
- .B dflag
- .PP
- .B echo
- [
- .B -n
- ]
- [
- .I arg
- ...
- ]
- .PP
- .B listen
- [
- .B -d
- ]
- [
- .I address
- ]
- .PP
- .B msg
- [
- .B -m
- .I nmsg
- ]
- [
- .B -p
- .I nproc
- ]
- .PP
- .B srv
- [
- .B -APWdp
- ]
- .I name
- .PP
- .B uname
- .I name
- [
- .I id
- |
- .BI : id
- |
- .BI % newname
- |
- .BI = leader
- |
- .BI + member
- |
- .BI - member
- ]
- .PP
- .B users
- [
- .B -dw
- |
- .I file
- ]
- .PP
- .B who
- .sp
- .PP
- .B fsys
- .I name
- .PP
- .B fsys
- .I name
- .B config
- .I device
- .PP
- .B fsys
- .I name
- .B venti
- [
- .I host
- ]
- .PP
- .B fsys
- .I name
- .B open
- [
- .B -APVWr
- ]
- [
- .B -c
- .I ncache
- ]
- .PP
- [
- .B fsys
- .I name
- ]
- .B close
- .PP
- .B fsys
- .I name
- .B unconfig
- .sp
- .PP
- [
- .B fsys
- .I name
- ]
- .B bfree
- .I addr
- .PP
- [
- .B fsys
- .I name
- ]
- .B block
- .I addr
- .I offset
- [
- .I count
- [
- .I data
- ]]
- .PP
- [
- .B fsys
- .I name
- ]
- .B clre
- .I addr
- .I offsets
- \&...
- .PP
- [
- .B fsys
- .I name
- ]
- .B clri
- .I files
- \&...
- .PP
- [
- .B fsys
- .I name
- ]
- .B clrp
- .I addr
- .I offset
- \&...
- .PP
- [
- .B fsys
- .I name
- ]
- .B create
- .I path
- .I uid
- .I gid
- .I perm
- .PP
- [
- .B fsys
- .I name
- ]
- .B df
- .PP
- [
- .B fsys
- .I name
- ]
- .B epoch
- [
- .B -ry
- ]
- .I n
- .PP
- [
- .B fsys
- .I name
- ]
- .B halt
- .PP
- [
- .B fsys
- .I name
- ]
- .B label
- .I addr
- [
- .I type
- .I state
- .I epoch
- .I epochclose
- .I tag
- ]
- .PP
- [
- .B fsys
- .I name
- ]
- .B remove
- .I files
- \&...
- .PP
- [
- .B fsys
- .I name
- ]
- .B snap
- [
- .B -a
- ]
- .PP
- [
- .B fsys
- .I name
- ]
- .B snaptime
- [
- .B -a
- .I hhmm
- ]
- [
- .B -s
- .I interval
- ]
- [
- .B -t
- .I timeout
- ]
- .PP
- [
- .B fsys
- .I name
- ]
- .B stat
- .IR files ...
- .PP
- [
- .B fsys
- .I name
- ]
- .B sync
- .PP
- [
- .B fsys
- .I name
- ]
- .B unhalt
- .PP
- [
- .B fsys
- .I name
- ]
- .B vac
- .I dir
- .PP
- [
- .B fsys
- .I name
- ]
- .B wstat
- .I file
- .I elem
- .I uid
- .I gid
- .I perm
- .I length
- .SH DESCRIPTION
- These are configuration and maintenance commands
- executed at the console of a
- .IR fossil (4)
- file server.
- The commands are split into three groups above:
- file server configuration,
- file system configuration,
- and file system maintenance.
- This manual page is split in the same way.
- .SS File server configuration
- .PP
- The
- dot
- .RI ( . )
- command
- reads
- .IR file ,
- treating each line as a command to be executed.
- Blank lines and lines beginning with a
- .L #
- character are ignored.
- Errors during execution are printed but do not stop the script.
- Note that
- .I file
- is a file in the name space in which
- .I fossil
- was started,
- .I not
- a file in any file system served by
- .IR fossil .
- .PP
- .I 9p
- executes a 9P transaction; the arguments
- are in the same format used by
- .IR 9pcon (8).
- .PP
- .I Dflag
- toggles the debug flag and prints the new setting.
- When the debug flag is set, all protocol messages
- and information about authentication is printed to
- standard error.
- .PP
- .I Echo
- behaves identically to
- .IR echo (1),
- writing to the console.
- .PP
- .I Listen
- manages the network addresses at which
- fossil is listening.
- With no arguments,
- .I listen
- prints the current list of addresses and their network directories.
- With one argument, listen
- .I address
- starts a new listener at
- .IR address ;
- the
- .B -d
- flag causes
- .I listen
- to remove the listener
- at the given address.
- .PP
- .I Msg
- prints the maximum internal 9P message queue size
- and the maximum number of 9P processes to
- allocate for serving the queue.
- The
- .B -m
- and
- .B -p
- options set the two variables.
- .PP
- .I Srv
- behaves like listen but uses
- .BI /srv/ name
- rather than a network address.
- With the
- .B -p
- flag,
- .I srv
- edits a list of console services rather than 9P services.
- With no arguments,
- .I srv
- prints the current list of services.
- With one argument, srv
- .I name
- starts a new service at
- .IR /srv/name ;
- the
- .B -d
- flag causes
- .I srv
- to remove the named service.
- See the
- .I [fsys] open
- command below for a description of the
- .B -APW
- options.
- .PP
- .I Uname
- manipulates entries in the user table.
- There is no distinction between users and groups:
- a user is a group with one member.
- For each user, the user table records:
- .TP
- .I id
- the string used to represent this user in the on-disk structures
- .TP
- .I name
- the string used to represent this user in the 9P protocol
- .TP
- .I leader
- the group's leader (see
- .IR stat (5)
- for a description of the special privileges held by a group leader)
- .TP
- .I members
- a comma-separated list of members in this group
- .PP
- The
- .I id
- and
- .I name
- are usually the same string, but need not be.
- Once an
- .I id
- is used in file system structures archived to Venti,
- it is impossible to change those disk structures,
- and thus impossible to rename the
- .IR id .
- The translation from
- .I name
- to
- .I id
- allows the appearance of renaming the user even
- though the on-disk structures still record the old name.
- (In a conventional Unix file system, the
- .I id
- is stored as a small integer rather than a string.)
- .I Leader
- and
- .I members
- are names, not ids.
- .PP
- The first argument to
- .I uname
- is the
- .I name
- of a user.
- The second argument is a verb, one of:
- .TP
- .I id
- create a user with name
- .RI ` name '
- and id
- .RI ` id ;'
- also create a home directory
- .BI /active/usr/ uname \fR
- .TP
- .BI : id
- create a user with name
- .RI ` name '
- and id
- .RI ` id ,'
- but do not create a home directory
- .TP
- .BI % newname
- rename user
- .RI ` name '
- to
- .RI ` newname ,'
- throughout the user table
- .TP
- .BI = leader
- set
- .IR name 's
- group leader
- to
- .IR leader .
- .TP
- .BI =
- remove
- .IR name 's
- group leader; then all members will be
- considered leaders
- .TP
- .BI + member
- add
- .I member
- to
- .IR name 's
- list of members
- .TP
- .BI - member
- remove
- .I member
- from
- .IR name 's
- list of members
- .LP
- If the verb is omitted, the entire entry for
- .I name
- is printed, in the form
- `\fIid\fL:\fIname\fL:\fIleader\fL:\fImembers\fR.'
- .LP
- The end of this manual page gives examples.
- .PP
- .I Users
- manipulates the user table.
- The user table is a list of lines in the form printed
- by the
- .I uname
- command.
- The
- .B -d
- flag resets the user table with the default:
- .IP
- .EX
- adm:adm:adm:sys
- none:none::
- noworld:noworld::
- sys:sys::
- glenda:glenda:glenda:
- .EE
- .PP
- Except
- .BR glenda ,
- these users are mandatory: they must appear in all user
- files and cannot be renamed.
- .PP
- The
- .B -r
- flag reads a user table from the named
- .I file
- in file system
- .BR main .
- The
- .B -w
- flag writes the table to
- .B /active/adm/users
- on the file system
- .BR main .
- .B /active/adm
- and
- .B /active/adm/users
- will be created if they do not exist.
- .PP
- .I Users
- .B -r
- .B /active/adm/users
- is automatically executed when the file system
- .B main
- is opened.
- .PP
- .I Users
- .B -w
- is automatically executed after each change to the user
- table by the
- .I uname
- command.
- .I Who
- prints a list of users attached to each active connection.
- .SS File system configuration
- .I Fsys
- sets the current file system to
- .IR name ,
- which must be configured and open (q.v.).
- The current file system name is
- displayed as the file server prompt.
- The special name
- .B all
- stands for all file systems;
- commands applied to
- .B all
- are applied to each file system in turn.
- The commands
- .BR config ,
- .BR open ,
- .BR venti ,
- and
- .B close
- cannot be applied to
- .BR all .
- .PP
- .I Fsys
- takes as an optional argument
- (after
- .BR name )
- a command to execute on the named file system.
- Most commands require that the named file system
- be configured and open; these commands can be invoked
- without the
- .BI fsys " name
- prefix, in which case the current file system is used.
- A few commands
- .RB ( config ,
- .BR open ,
- and
- .BR unconfig )
- operate on unopened file systems; they require the prefix.
- .PP
- .I Config
- creates a new file system named
- .I name
- using disk file
- .I device .
- This just adds an entry to fossil's internal table.
- .PP
- .I Venti
- establishes a connection to the Venti server
- .I host
- (by default, the environment variable
- .B $venti
- or the network variable
- .BR $venti )
- for use by the named file system.
- If no
- .I venti
- command is issued before
- .IR open ,
- the default Venti server will be used.
- If the file system is open,
- and was not opened with the
- .B -V
- flag,
- the command redials the Venti server.
- This can be used to reestablish broken connections.
- It is not a good idea to use the command to switch
- between Venti servers, since Fossil does not keep track
- of which blocks are stored on which servers.
- .PP
- .I Open
- opens the file system, reading the
- root and super blocks and allocating an in-memory
- cache for disk and Venti blocks.
- The options are:
- .TP
- .B -A
- run with no authentication
- .TP
- .B -P
- run with no permission checking
- .TP
- .B -V
- do not attempt to connect to a Venti server
- .TP
- .B -W
- allow wstat to make arbitrary changes to the user and group fields
- .TP
- .B -r
- open the file system read-only
- .TP
- .BI -c " ncache
- allocate an in-memory cache of
- .I ncache
- (by default, 1000)
- blocks
- .PP
- The
- .I -APW
- settings can be overridden on a per-connection basis
- by the
- .I srv
- command above.
- .PP
- .I Close
- flushes all dirty file system blocks to disk
- and then closes the device file.
- .PP
- .I Unconfig
- removes the named file system (which must be closed)
- from fossil's internal table.
- .SS File system maintenance
- .I Bfree
- marks the block at disk address
- .I addr
- as available for allocation.
- Before doing so, it prints a
- .I label
- command (q.v.)
- that can be used to restore the block to its previous state.
- .PP
- .I Block
- displays (in hexadecimal)
- the contents of the block at disk address
- .IR addr ,
- starting at
- .I offset
- and continuing for
- .I count
- bytes or until the end of the block.
- If
- .I data
- (also hexadecimal)
- is given, the contents in that range are
- replaced with data.
- When writing to a block,
- .I block
- prints the old and new contents,
- so that the change is easily undone.
- Editing blocks is discouraged.
- .PP
- .I Clre
- zeros an entry from a disk block.
- Before doing so, it prints a
- .I block
- command that can be used
- to restore the entry.
- .PP
- .I Clri
- removes the internal directory entry
- and abandons storage associated with
- .IR files .
- It ignores the usual rules for sanity, such as checking against
- removing a non-empty directory.
- A subsequent
- .I flchk
- (see
- .IR fossil (4))
- will identify the abandoned storage so it can be reclaimed with
- .I bfree
- commands.
- The
- .I perm
- is formatted as described in the
- .I stat
- command ;
- creating files or directories with the
- snapshot
- .RB ( s )
- bit set is not allowed.
- .PP
- .I Clrp
- zeros a pointer in a disk block.
- Before doing so, it prints a
- .I block
- command that can be used to restore the entry.
- .PP
- .I Create
- creates a file on the current file system.
- .I Uid
- and
- .I gid
- are uids
- .RI ( not
- unames;
- see the discussion above, in the description
- of the
- .I uname
- command).
- .I Perm
- is the low 9 bits of the permission mode of the file,
- in octal.
- The
- .BR -a ,
- .BR -d ,
- and
- .B -l
- flags set the append-only, directory, and lock bits.
- .PP
- .I Df
- prints the amount of used disk space in the write buffer.
- .PP
- .I Epoch
- sets the low file system epoch.
- Snapshots in the file system are given increasing epoch numbers.
- The file system maintains a low and a high epoch number,
- and only allows access to snapshots in that range.
- The low epoch number can be moved forward to discard old snapshots
- and reclaim the disk space they occupy.
- (The high epoch number is always the epoch of the currently
- active file system.)
- .PP
- The command
- ``\fLepoch\fI n''\fR
- is used to propose changing the low epoch to
- .IR n .
- In response,
- .I fossil
- scans
- .B /archive
- and
- .B /snapshot
- for snapshots that would be discarded, printing their
- epoch numbers and the
- .I clri
- commands necessary to remove them.
- The epoch is changed only if no such paths are found.
- The usual sequence of commands is (1) run epoch to
- print the snapshots and their epochs, (2) clri some snapshots,
- (3) run epoch again.
- If the file system is completely full (there are no free blocks),
- .I clri
- may fail because it needs to allocate blocks.
- For this situation,
- the
- .B -y
- flag to epoch forces the epoch change even when
- it means discarding currently accessible snapshots.
- Note that when there are still snapshots in
- .BR /archive ,
- the archiver should take care
- of those snapshots (moving the blocks from disk to Venti)
- if you give it more time.
- .PP
- The
- .B -r
- flag to epoch causes it to remove any now-inaccessible
- snapshot directories once it has changed the epoch.
- This flag only makes sense in conjunction with the
- .B -y
- flag.
- .PP
- .I Epoch
- is a very low-level way to retire snapshots.
- The preferred way is by setting an automatic timer
- with
- .IR snaptime .
- .PP
- .I Halt
- suspends file system activity;
- .I unhalt
- resumes activity.
- .PP
- .I Label
- displays and edits the label associated with a block.
- When editing, a parameter of
- .B -
- means leave that field unchanged.
- Editing labels is discouraged.
- .PP
- .I Remove
- removes
- .IR files .
- .PP
- .I Snap
- takes a temporary snapshot of the current file system,
- recording it in
- .BI /snapshot/ yyyy / mmdd / hhmm \fR,
- as described in
- .IR fossil (4).
- The
- .B -a
- flag causes
- .I snap
- to take an archival snapshot, recording it in
- .BI /archive/ yyyy / mmdd \fR,
- also described in
- .IR fossil (4).
- .PP
- .I Snaptime
- displays and edits the times at which snapshots are automatically
- taken.
- An archival snapshot is taken once a day, at
- .IR hhmm ,
- while temporary snapshots are taken at multiples of
- .I interval
- minutes.
- Temporary snapshots are discarded once they are
- .I timeout
- minutes old.
- With no arguments,
- .I snaptime
- prints the current snapshot times.
- The
- .B -a
- and
- .B -s
- options set the archive and snapshot times.
- An
- .I hhmm
- or
- .I interval
- of
- .L none
- can be used to disable that kind of automatic snapshot.
- The
- .B -t
- option sets the snapshot timeout.
- If
- .I timeout
- is
- .LR none ,
- temporary snapshots are not automatically discarded.
- By default, all three times are set to
- .LR none .
- .PP
- .I Stat
- displays metadata for each of the named
- .IR files ,
- in the form:
- .IP
- .EX
- stat \fIfile elem uid gid perm length
- .EE
- .LP
- (Replacing
- .B stat
- with
- .B wstat
- yields a valid command.)
- The
- .I perm
- is an octal number less than or equal to 777,
- prefixed with any of the following letters
- to indicate additional bits.
- .IP
- .EX
- .ta +4n
- a \fRappend only
- d \fRdirectory
- l \fRexclusive use
- s \fRis the root of a snapshot
- t \fRtemporary bit
- A \fRMS-DOS archive bit
- G \fRsetgid
- H \fRMS-DOS hidden bit
- L \fRsymbolic link
- S \fRMS-DOS system bit
- U \fRsetuid
- Y \fRsticky
- .EE
- The bits denoted by capital letters are included
- to support non-Plan 9 systems.
- They are not made visible by the 9P protocol.
- .PP
- .I Sync
- writes dirty blocks in memory to the disk.
- .PP
- .I Vac
- prints the Venti score for a
- .IR vac (1)
- archive containing the tree rooted
- at
- .IR dir ,
- which must already be archived to Venti
- (typically
- .IR dir
- is a directory in the
- .B /archive
- tree).
- .PP
- .I Wstat
- changes the metadata of the named
- .IR file .
- Specifying
- .B -
- for any of the fields means ``don't change.''
- Attempts to change the
- .B d
- or
- .B s
- bits in the
- .I perm
- are silently ignored.
- .SH EXAMPLES
- .IR Sources ,
- the Plan 9 distribution file server,
- uses the following configuration file:
- .IP
- .EX
- srv -p fscons.sources
- srv -p fscons.sources.adduserd
- srv sources
- fsys main config /dev/sdC0/fossil.outside
- fsys main open -c 25600
- fsys main
- users /active/adm/users
- listen tcp!*!564
- msg -m 40 -p 10
- snaptime -a 0000 -s 15
- .EE
- .LP
- The second console is used by the daemon
- that creates new accounts.
- .PP
- To add a new user with
- .I name
- and
- .I id
- .B rob
- and create his home directory:
- .IP
- .EX
- uname rob rob
- .EE
- .PP
- To create a new group
- .B sys
- (with no home directory)
- and add
- .B rob
- to it:
- .IP
- .EX
- uname sys :sys
- uname sys +rob
- .EE
|