vesta.cfg - Configuration file for the Vesta configuration management system



Most Vesta tools use a standard mechanism for determining configuration information about a Vesta installation. This mechanism attempts to locate a configuration file named vesta.cfg by searching in a number of locations. The vgetconfig(1) man page describes a command-line interface for determining the location of the configuration file and for printing the value of a particular configuration variable. The meanings of the configuration variables recognized by the various tools are documented in their individual man pages.

Locating the Configuration File

The Vesta tools search for the vesta.cfg file in the following locations:

  1. The file named by the VESTACONFIG environment variable is used if that environment variable is defined and the file exists.
  2. Otherwise, the vesta.cfg file in the directory named by the HOME environment variable is used if that environment variable is defined and the file exists.
  3. Otherwise, /etc/vesta.cfg is used if it exists.

If all of these search locations fail, the Vesta tools that require the configuration file will print an error message and exit.

A few tools (such as vgetconfig and QuickWeed) take command line paramaters to override the location of configuration files.

Configuration File Syntax

Here is a EBNF grammar for Vesta configuration files.

  config-file  ::= ws section ws new-line line*
  line         ::= ws ( section | option | comment ) ws new-line
  section      ::= '[' ws name ws ']' 
		 | '[' "include" ws name ws ']'
  option       ::= name ws '=' ws value
  comment      ::= ( ';' | "//" ) non-new-line* | <empty>
  name         ::= ( letter | digit | special )+
  value        ::= non-new-line*
  new-line     ::= <ASCII CR> | <ASCII LF>
  non-new-line ::= <any ASCII character except those for new-line>
  ws           ::= <space> | <tab>
This grammar is slightly ambiguous, but the intent should be clear. The file is a sequence of lines, each of which is either a section name in square brackets, a <name,value> pair separated by an equal sign, or a comment. Leading and trailing white space is ignored, as are blank lines and comment lines. A comment line has a semicolon or two slashes as its first non-whitespace characters.

The configuration file defines a two-level naming structure, with sections as the upper level and the names of <name, value> pairs as the lower level. Once the file has been parsed, the basic operation is to lookup a <section, name> pair, obtaining the associated value. See the example configuration file below.

There is a facility for one configuration file to refer to other ones. Notice the second alternative for the section nonterminal in the grammar above. When this form is used, it doesn't introduce a section name; instead, if name specifies a file, it is read and processed. That is, if a file contains a line of the form:

  [include /proj/vesta/pkg/config-file/vesta.cfg]
then the line will effectively be replaced by the sections contained in the file /proj/vesta/pkg/config-file/vesta.cfg. If instead, name specifies a directory, all of the files in it and any sub-directories are read and processed. The file names are sorted as strings, but comparing embedded sequences of digits as decimal integers. (So, for example "foo_10_bar" will sort after "foo_2_bar".) Files in sub-directories are sorted first by the name of the sub-directory itself and then within the sub-directory by file name.

All options must be in a section. Any file (included or the main file) must have a named section before any options. See the example below.

This mechanism is chiefly intended for overriding a set of shared defaults. A configuration file containing standard definitions is stored in a public location (usually /etc/vesta.cfg). A second configuration file is stored in the user's home directory or at the location specified by the environment variable VESTACONFIG. This second file begins with an include line that mentions the first file, then continues with additional sections that either add to or override the standard definitions. Thus, it is not an error for a <section, name> pair to appear more than once in the course of configuration file processing (which may involve reading multiple files). The value encountered last wins.

Example Configuration File

Here is a sample configuration file. This file includes a central configuration file, and then overrides some configuration variables in the Evaluator and Run_Tool sections.

  // Include standard configuration file
  [include /etc/vesta.cfg]
  // ----------------------------------------------
  // always print a stack trace on runtime errors
  Switches = -stack
  // host to use for DU4.0 builds
  DU4.0 =
  // ----------------------------------------------
  // print RunToolServer debugging info
  helper_switches = -d

See Also

vgetconfig(1) QuickWeed(1)
This page was generated automatically by mtex software.