QEF home page

Chapter 10: The File System Integrity Check (FSIC) System

The Guide's Table of Contents Previous Chapter Bottom Of Page Next Chapter

The File System Integrity Check (FSIC) package is a combination of files, programs and a qsg script (see fsic(x-qsg)) that aid in the maintenance of databases within the fsic directory of source, object, and installation trees.


10.1) Introduction

FSIC is a package, provided as part of the QEF product, that is used to check the integrity of source, object, and destination trees.

When qef is run in the FSIC directory in a source tree, it compares the list of existing files against a list of files that are supposed to exist and reports any discrepancies such as missing files, new files, or files without a version system administration file.

Similar types of discrepancies are also reported when qef is run in the FSIC directory of an object tree. In this case, the list of existing files and directories for both the object and destination trees are checked against a database that defines the set of files that should exist and the exceptions or extensions to that set for specific configurations.

Typically the source tree check is run manually by the project administrator on a regular basis to ensure the completeness and correctness of the source file system. The object tree check should be run automatically as part of the build process and whenever the database is modified.

Given the volatility and size of modern software projects, we believe the application of the FSIC package is essential to preserve and protect the health of a software project.

This chapter serves to introduce the FSIC system. The definitive documentation is contained in the x_db database x-qfsic, as will be described later, and the manual sections fsic(1), sfsic(1), and bfsic(1).

FSIC Tools The following are the tools and files of the FSIC package:
dirsetup fsic The dirsetup fsic dir-set contains a prototype of a FSIC directory with the required files. It may be used to set up the initial database.
qsg fsic script This script is all that's needed in the FSIC directory's qeffile. Supported targets are listed in a later section.
bfsic bfsic is used to compare the lists of existing installed and object file systems against the FSIC database inst.fl, objs.fl, deviates.fl, except/<sysnm>.fl, and<qtree>/lib/bfsic.cf. A list of discrepancies is created in ,p.errors and recognized temporary files are listed in ,i.tmps and ,o.tmps. bfsic is also used to correct the database.
sfsic sfsic is used to compare the lists of existing source and version system files against the FSIC files.fl list. Typically sfsic is used to modify the database or to create lists of discrepancies, temporary files, and files being edited.
x-qfsic This x_db database describes the tools, files, databases, error messages, and procedures of the FSIC package. The first (the default) item lists the major items and sections of the database, as in:
    % x-qfsic
    x-qfsic : file system integrity package eXplanatory D.B.
    
    fsic-intro : Introduction to the FSIC package
    Src : procedure to check the source tree
    Post : procedure to check the object and installed trees
    Setup : procedure to set up Post files
    fsic-programs : the supporting FSIC programs and files
    fsic-files : files of the fsic directory
    fsic/qeffile : fsic qeffile script and its contents
    Src-lists : lists of source files created by Src process
    Src-files : lists of files possibly produced by Src process
    Post-files : lists of files possibly produced by Post process
    sfsic-errors : list of possible errors reported by sfsic
    bfsic-errors : list of possible errors reported by bfsic
    bfsic-types : types used in bfsic
<Q>/lib/bfsic.cf This file is used to specify patterns that match the names of temporary files. Path names that are read from the lists of the installed, and object trees that are matched by a pattern of the bfsic.cf file are output to ,i.tmps and ,o.tmps respectively. See bfsic.cf(x-qef).
<Q>/lib/sfsic.cf This file is the default configuration file read by sfsic. It contains two classes of control lines: file/pattern action lines and type/pattern action lines. File/pattern action lines specify actions to be taken when a file that matches the pattern is encountered. One of those actions can be to assign a type to file. For example:
    ~/root.vrs -tgz -w,s.cons
is applied to files whose leaf name is "root.vrs". The file is assigned types `g' and `z' and also written to the file ,s.cons.

The type/pattern action lines specify what actions to take for files with specified types. For example:

    &Sgs Ss -e07 missing g-file for S type file
specifies that files whose type &ed with types "Sgs" yields types "Ss" are listed as raising error 07.
Note:The current sfsic.cf file manages RCS, CVS, SCCS, and perforce version systems. Sites that use another version system will have to modify the sfsic.cf or create their own to handle their system.
rls, fixflist, rmlist A variety of other tools are used by the FSIC package. Three in particular are important and/or useful. rls is used to create the file lists that are checked. rmlist is used to unlink (i.e., rm or rmdir) files named in its input. fixflist is used to remove entries from a file list for files that do not exist.

10.2) The FSIC Database Files

The FSIC directory is normally located in @QefAdm/fsic, where @QefAdm defaults to QefAdm (if it exists), or . if it doesn't.
Note:@QefAdm can be set in the root.vrs file.
To initialize the database, chdir to the source root directory and use:
    % dirsetup fsic
    - create QefAdm/fsic/deviates.fl
    - create QefAdm/fsic/except/example.fl
    - create QefAdm/fsic/except/read.me; mode=0444
    - create QefAdm/fsic/files.fl
    - create QefAdm/fsic/inst.fl
    - create QefAdm/fsic/objs.fl
    - create QefAdm/fsic/qeffile; mode=0444
    - create QefAdm/fsic/read.me; mode=0444
    - create QefAdm/treedirs/read.me; mode=0444
    - create QefAdm/treedirs/treedirs.lst

The read.me files are just for documentation. Brief descriptions of the other files follow:

qeffile

FSIC qeffile script -- see fsic/qeffile(x-qfsic).
Generates script to invoke various FSIC checks as listed by:

    % qef -Ptargets
    Src:	check source directory (source tree only)
    Checks:	check s-files vs. g-files (source tree only)
    Post:	check object and installation trees
		(object tree only)
    Setup:	build config files if required
    Note:	Only allowed in a subdirectory called fsic.
Note:The default targets are Src in a baseline or master tree and Post in an object tree.
The qeffile might need to be modified to use different sfsic.cf and/or bfsic.cf files, but otherwise it should be usable as is.
files.fl

list of all known and regular source files -- see files.fl(x-qfsic).
This file is a list of all the files of the source tree including those that have a version system administration file but are obsolete. The lines in the file consist of the pathname relative to the source root directory and a type which is one of:
Sregistered S-file -- should be both a g-file and a version system administration file.
Uregistered unadministered file -- should be a g-file but no version system file
Tregistered unadministered temporary file -- a known temporary file that is to be preserved but is not part of a source distribution
Oregistered old file -- has a version file but no text as the file is deemed obsolete or old.

inst.fl

list of all known installed tree paths -- see inst.fl(x-qfsic).
This should be a sorted list of the superset (see note) of files and directories to be found in the Destination directory. Directories must have a trailing `/'.
Note: The {inst,objs}.fl lists should list all the files to be found on all platforms for all configurations, within reason. The exceptions to these lists are specified in the individual system's exception file. However, in some instances (particularly on windows) files may exist on only one platform, thus it is much easier to not name such files in the master list, but just name it in the exception list. Otherwise such a file would have to be named in every other exception list as a legitimately missing file.

objs.fl

list of all object tree paths -- see objs.fl(x-qfsic).
This should be a sorted list of the superset (see above note) of files and directories to be found in the object tree. Directories must have a trailing `/'.

<sysnm>.fl

exception list -- see <sysnm>.fl(x-qfsic).
This file lists the exceptions to the inst.fl and objs.fl lists for the <sysnm> system. In addition to the system name, exceptions are bound to a key specified by @FSIC_Key (defaults to `a') which is used to specify the configurations to which the exception is applied. The exceptions are specified using one of the following keys: the UPPER case keys are applied to the installation directory, whereas the lower case version applies to the object tree:
E/eFile or directory is should exist (i.e., is extra) in the installed/object tree. The file should exist in specific tree, but should not be named in the corresponding inst.fl or objs.fl list.
N/nNamed file or directory and its contents should not to be found in installed/object tree.
Note:The syntax and contents of this file and the deviations file are described by the command:
    % bfsic -X
    -I ilist -- list of existing installed files to be checked
    ...

deviates.fl

list of normal deviations -- see deviates.fl(x-qfsic).
This file lists normal deviations, that is files that can normally exist, but deviate from the FSIC database. For example, the <qtree>/data/traits directory will contain host.tab files which cannot be registered in the inst.fl list due to the range of possible names. The entries in this file consist of a pathname (in which the file name can be a pattern) and one or more of the following types:
O/oThe Installed/Object file or directory is optional.
R/rThe Installed/Object file is required -- used to override an [NnOo]-type exception.
As is the case with the exception list, the UPPER case types refer to the Destination tree, whereas the lower case version refers to the object tree.

treedirs.lst

list of qeffile and *.vrs files used by treedirs -- see treedirs.lst(x-qfsic).
This file is actually created by the Src construction. It can also be created using treedirs --L.

10.3) Checking and Fixing the Source Tree

The source tree check is accomplished by chdiring to the source @QefAdm/fsic directory and running qef. Basically this runs:
    # run rls in the source root to write file list to ,tmp
    % cush -d ../.. -o. ,tmp rls -sf

    # if using CVS, list of CVS Repository put into ,tmp2

    # run sfsic to check list against files.fl
    % cush -o ,s.errors sfsic -Ffiles.fl -S ,tmp
In addition to the errors written to ,s.errors via the standard output, there are a number of other files that may be produced. What files are created and what they contain is controlled by the sfsic.cf file. The standard sfsic.cf produces, in part, ,s.pfiles -- list of SCCS p-files; ,s.cons -- list of qeffile and *.vrs files (renamed to treedirs.lst; ,s.tmps -- list of temporary files (e.g., core, .nfs*); ,s.asrc -- all source files; ,s.csrc -- C, Yacc, Lex sources; and ,s.osrc -- source files not in ,s.csrc. The last three files are copied to Dist.lst, Csrc.lst, and Osrc.lst if different than the target file. If the version system is RCS, a list of the locked files is produced.
sfsic errors

The list of files being edited and lists of the source files and temporary files are useful, but the most important product of the process is the ,s.errors file. This file will contain lines consisting of a filename, a tab, `#' followed by an error code, a brief description of the error, and the types for the file as assigned by the files.fl file and the sfsic.cf processing. The following are example lines:

    missing	# e07 missing g-file for S type file (type=Ss)
    newfile	# e05 new g-file (type=gz)
There are thirteen errors that can be raised using the standard sfsic.cf -- see sfsic-errors(x-qfsic). Each error is described in its own x-qfsic item as in:
    % x-qfsic e05
    e05 : new g-file
    
    Explanation:
    The named file exists, but is not any recognizable type thus
    is assumed to be a g-file, but it is not named in files.fl.
    
    To Fix:
    If the file should not exist, it should be removed:

	% rm path

    Otherwise, if the file should be administered, a version file
    should be created and then registered as `S' type file in
    files.fl:

	% vci new path
	% sfsic -CS path

    Otherwise, the file should be registered using:

	% sfsic -CU path # if file is source but unadministered
	# or
	% sfsic -CT path # if file is not source but is preserved

    See also: sfsic-errors
After making corrections, qef should be rerun to ensure that the errors have been eliminated and that no new errors have been introduced.
Note:When getting started there will probably be a large number of errors. However, two sfsic features can help. sfsic can read the files to be processed from stdin and the --se-code option can be used to select the error codes to be processed, hence one can process all the e05 codes at once using:
    % sfsic -f -CS -se05 < ,s.errors

10.4) Checking and Fixing the Inst/Obj Trees

Checking the installed and object trees is much like checking the source tree. qef is run in the fsic directory in the object tree. rls is run in both the installed and object trees. The resulting lists and the FSIC database files are then processed by bfsic to produce a list of errors (saved in ,p.errors) and temporary files found in the installed tree (,i.tmps) or object tree (,o.tmps).

The error messages are much the same as those for the source tree, specifically a file name, a tab and a hash, an `i' or `o' followed by an error code, and a short description of the error. For example:

    missing	# i08 missing inst file (type=L)
    newinst	# i05 new inst file (type=F)
    missing	# o08 missing objs file (type=l)
    newobj	# o05 new objs file (type=f)
As is the case with the source errors, the installed and object errors are described in the x-qmisc database. The list of bfsic errors can be retrieved using:
    % x-qfsic bfsic-errors
FSIC_Key The installed/object tree checks differ from the source checks in that they have to check a wide range of configurations whereas the source check deals with a single tree. The installed and object trees may differ because of the platform or because of semantic options. The except/sysnm.fl file is used to hold exceptions for a system. Variations due to semantic options are distinguished using the setting of @FSIC_Key. Types for files in the exception list are bound to keys as in:
    path Nab
which indicates that path has type `N' for trees with a @FSIC_Key of either `a' or `b'. Note that @FSIC_Key defaults to `a'.
Fixing the Database bfsic is used to correct or modify the database.
    # add newtypes and remove oldtypes for file ...
    % bfsic -A<newtypes> -R<oldtypes> files ...

    # add type L for ,p.error named files with error code i08
    % bfsic -si08 -AL < ,p.errors
The following are the types supported by bfsic and their use. Note the UPPER case versions of the flag apply to the installed tree, whereas the lower case version applies to the object tree.
L/lThe argument files are added to inst.fl (for `L') or to objs.fl (for `l'). Note that files added to the {inst,objs}.fl list are applied to all platforms and configurations. If a file is limited to the current platform or configuration it should be given a `E/e' type.
E/e The argument files are added to the exception file for the platform with type `E' or `e' coupled with @FSIC_Key. This is used for files that should exist, but only for a small number of configurations.
N/n The argument files are added to the exception file for the platform with type `N' or `n' coupled with @FSIC_Key. The argument files should not exist, even though named in the {inst,objs}.fl file.
O/o The argument files or patterns are added to the deviations.fl. Wild card pattern matching characters can be used in the basename to specify that matched files are optional, as in:
    man/cat1/*.1 O
R/r The argument files are added to the deviations.fl with type `R' or `r'. Such a type specifies that the associated file is required (i.e., not optional). This type is only required if the file in question would be deemed to be optional due to a [Oo]-type pattern. For example, <qtree>/data/qremote may contain arbitrary files used to interface to the host with the same name as the host, thus the line:
    data/qremote/*  O
appears in the deviations.fl file for the Q-Tree. However, the README file in the same directory should exist but the above line will match the README file, so to the line:
    data/qremote/README  R
is added before the qremote/* line.

Initially the exception file will not exist. The command

    % qef Setup
will create any files used by the check that do not exist.

Conclusions The major objective of the FSIC system is to maintain the cleanliness and health of the file systems. Initially with an empty database, it is recommended that you just get close and then use subsequent builds on both the current and other hosts until the database converges on an accurate representation of subject files system trees. Once close to steady-state is reached, the FSIC databases require little care, but do provide a cheap and effective mechanism for ensuring the product and its construction environment are not jeopardized by extraneous or missing files.

c120.qh - 9.3 - 03/10/22 QEF Home The Guide's Table of Contents Previous Chapter Top Of Page Next Chapter