|id||the string used to represent this user in the on-disk structures|
|name||the string used to represent this user in the 9P protocol|
|leader||the groups leader (see stat(5) for a description of the special privileges held by a group leader)|
|a comma-separated list of members in this group|
|The id and name are usually the same string, but need not be. Once an id is used in file system structures archived to Venti, it is impossible to change those disk structures, and thus impossible to rename the id. The translation from name to 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 id is stored as a small integer rather than a string.) Leader and members are names, not ids.|
|The first argument to uname is the name of a user. The second argument is a verb, one of:|
|id||create a user with name name and id id; also create a home directory /active/usr/uname|
|:id||create a user with name name and id id, but do not create a home directory|
|rename user name to newname, throughout the user table|
|set names group leader to leader.|
|=||remove names group leader; then all members will be considered leaders|
|add member to names list of members|
|remove member from names list of members|
|If the verb is omitted, the entire entry for name is printed, in the form id:name:leader:members.|
|The end of this manual page gives examples.|
|Users manipulates the user table. The user table is a list of lines in the form printed by the uname command. The -d flag resets the user table with the default:|
|adm:adm:adm:sys none:none:: noworld:noworld:: sys:sys:: glenda:glenda:glenda:|
The -r flag reads a user table from the named file in file system main. The -w flag writes the table to /active/adm/users on the file system main. /active/adm and /active/adm/users will be created if they do not exist.
Users -r /active/adm/users is automatically executed when the file system main is opened.
Users -w is automatically executed after each change to the user table by the uname command.
Who prints a list of users attached to each active connection.
Fsys sets the current file system to name, which must be configured and open (q.v.). The current file system name is displayed as the file server prompt. The special name all stands for all file systems; commands applied to all are applied to each file system in turn. The commands config, open, venti, and close cannot be applied to all.
Fsys takes as an optional argument (after 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 fsysname prefix, in which case the current file system is used. A few commands (config, open, and unconfig) operate on unopened file systems; they require the prefix.
Config creates a new file system named name using disk file device. This just adds an entry to fossils internal table. If device is missing, the file argument to fossils -f option will be used instead; this allows the fossil configuration file to avoid naming the partition that it is embedded in, making it more portable.
Venti establishes a connection to the Venti server host (by default, the environment variable $venti or the network variable $venti) for use by the named file system. If no venti command is issued before open, the default Venti server will be used. If the file system is open, and was not opened with the -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.
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:
The -APW settings can be overridden on a per-connection basis by the srv command above.
-A run with no authentication -P run with no permission checking -V do not attempt to connect to a Venti server -W allow wstat to make arbitrary changes to the user and group fields -a do not update file access times; primarily to avoid wear on flash memories -r open the file system read-only -cncache allocate an in-memory cache of ncache (by default, 1000) blocks
Close flushes all dirty file system blocks to disk and then closes the device file.
Unconfig removes the named file system (which must be closed) from fossils internal table.
Bfree marks the block at disk address addr as available for allocation. Before doing so, it prints a label command (q.v.) that can be used to restore the block to its previous state.
Block displays (in hexadecimal) the contents of the block at disk address addr, starting at offset and continuing for count bytes or until the end of the block. If data (also hexadecimal) is given, the contents in that range are replaced with data. When writing to a block, block prints the old and new contents, so that the change is easily undone. Editing blocks is discouraged.
Clre zeros an entry from a disk block. Before doing so, it prints a block command that can be used to restore the entry.
Clri removes the internal directory entry and abandons storage associated with files. It ignores the usual rules for sanity, such as checking against removing a non-empty directory. A subsequent flchk (see fossil(4)) will identify the abandoned storage so it can be reclaimed with bfree commands.
Clrp zeros a pointer in a disk block. Before doing so, it prints a block command that can be used to restore the entry.
Check checks the file system for various inconsistencies. If the file system is not already halted, it is halted for the duration of the check. If the archiver is currently sending a snapshot to Venti, the check will refuse to run; the only recourse is to wait for the archiver to finish.
A list of keyword options control the check. The pblock, pdir, and pfile options cause check to print the name of each block, directory, or file encountered.
By default, check reports errors but does not fix them. The bclose, clri, clre, and clrp options specify correcting actions that may be taken: closing leaked blocks, clearing bad file directory entries, clearing bad pointers, and clearing bad entries. The fix option enables all of these; it is equivalent to bclose clri clre clrp.
By default, check scans the portion of the active file system held in the write buffer, avoiding blocks stored on Venti or used only in snapshots. The venti option causes check to scan the portion of the file system stored on Venti, and the snapshot option causes check to scan old snapshots. Specifying snapshot causes check to take a long time; specifying venti or (worse) venti snapshot causes check to take a very long time.
Create creates a file on the current file system. Uid and gid are uids (not unames; see the discussion above, in the description of the uname command). Perm is the low 9 bits of the permission mode of the file, in octal. The a, d, and l mode prefixes set the append-only, directory, and lock bits. The perm is formatted as described in the stat command; creating files or directories with the snapshot(s) bit set is not allowed.
Df prints the amount of used disk space in the write buffer.
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.)
With no argument epoch reports the current low and high epoch numbers. The command epoch n is used to propose changing the low epoch to n. In response, fossil scans /archive and /snapshot for snapshots that would be discarded, printing their epoch numbers and the 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), clri may fail because it needs to allocate blocks. For this situation, the -y flag to epoch forces the epoch change even when it means discarding currently accessible snapshots. Note that when there are still snapshots in /archive, the archiver should take care of those snapshots (moving the blocks from disk to Venti) if you give it more time.
The -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 -y flag.
Epoch is a very low-level way to retire snapshots. The preferred way is by setting an automatic timer with snaptime.
Halt suspends all file system activity; unhalt resumes activity.
Label displays and edits the label associated with a block. When editing, a parameter of - means leave that field unchanged. Editing labels is discouraged.
Remove removes files.
Snap takes a temporary snapshot of the current file system, recording it in /snapshot/yyyy/mmdd/hhmm, as described in fossil(4). The -a flag causes snap to take an archival snapshot, recording it in /archive/yyyy/mmdd, also described in fossil(4). By default the snapshot is taken of /active, the root of the active file system. The -s flag specifies a different source path. The -d flag specifies a different destination path. These two flags are useful together for moving snapshots into the archive tree.
Snapclean immediately discards all snapshots that are more than timeout minutes old. The default timeout is the one set by the snaptime command. The discarding is a one-time event rather than a recurring event as in snaptime.
Snaptime displays and edits the times at which snapshots are automatically taken. An archival snapshot is taken once a day, at hhmm, while temporary snapshots are taken at multiples of interval minutes. Temporary snapshots are discarded after they are timeout minutes old. The snapshot cleanup runs every timeout minutes or once a day, whichever is more frequent, so snapshots may grow to an age of almost twice the timeout before actually being discarded. With no arguments, snaptime prints the current snapshot times. The -a and -s options set the archive and snapshot times. An hhmm or interval of can be used to disable that kind of automatic snapshot. The -t option sets the snapshot timeout. If timeout is temporary snapshots are not automatically discarded. By default, all three times are set to
Stat displays metadata for each of the named files, in the form:
The bits denoted by capital letters are included to support non-Plan 9 systems. They are not made visible by the 9P protocol.
stat file elem uid gid perm length (Replacing stat with wstat yields a valid command.) The perm is an octal number less than or equal to 777, prefixed with any of the following letters to indicate additional bits. a append only d directory l exclusive use s is the root of a snapshot t temporary bit A MS-DOS archive bit G setgid H MS-DOS hidden bit L symbolic link S MS-DOS system bit U setuid Y sticky
Sync writes dirty blocks in memory to the disk.
Vac prints the Venti score for a vac(1) archive containing the tree rooted at dir, which must already be archived to Venti (typically dir is a directory in the /archive tree).
Wstat changes the metadata of the named file. Specifying - for any of the fields means dont change. Attempts to change the d or s bits in the perm are silently ignored.
Sources, the Plan 9 distribution file server, uses the following configuration file:
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 The second console is used by the daemon that creates new accounts. To add a new user with name and id rob and create his home directory: uname rob rob To create a new group sys (with no home directory) and add rob to it: uname sys :sys uname sys +rob To save an old (but not yet discarded) snapshot into the archive tree: snap -a -s /snapshot/2003/1220/0700 -d /archive/2003/1220