NAME

mkxprof - make XML LCFG profile

DESCRIPTION

This command creates XML profiles from LCFG sources files. If source filenames are given on the command line, profiles will be generated for any host files listed explicitly, and for any which change because they depend on changes in one of the listed files.

If no files are specified, all source files (including headers, defaults and package lists) in the corresponding paths are examined, and any which have changed since the last run are recompiled.

mkxprof is normally run from the LCFG profile component.

SYNOPSIS

/usr/sbin/mkxprof [options] [filename..]

OPTIONS

-c dir

This directory is used to maintain caches of persistent state between invocations of mkxprof. It includes spanning map data, dependency information and status recrods. When running as root, the default is /var/lcfg/conf/server/cache. When running as any other user, no persistent state information is maintained unless this option is specified.

-C component

Error messages are passed to the log system for the named component.

-d

If this option is present, mkxprof runs as a daemon, polling or waiting for notifications of changed source files.

-D flags

This option enables debugging for the categories listed by the comma-separated list of flags. Flags may be prefixed with + or - to enable/disable specific categories. Possible flags are:

ack - Acknowledgements
assign - Resource assignments
changes - Profile changes
context - Contexts
cpp - CPP output
cppcmd - CPP commands
daemon - Daemon polling
defaults - Adding defaults
depend - Dependency generation
lock - Status DBM locking
mapchange - Changes in exported resources
maps - Spanning maps
meta - Meta-resource processing
mutate - Mutations
notify - Client notification
order - List sorting
packages - Packages
publish - Profile publication
ref - References
rsync - Rsync fetches
sources - Source files
validate - Validations
-E path

Search the (comma-separated) path for default files. The files must have an extension of .def. The string %r will be substituted with the value of the profile.release resource. The default is /usr/lib/lcfg/defaults/server.

-f speclist

The speclist is a (comma-separated) list of specifications of the form dst=src. rsync is used to copy each src to the corresponding dst before compiling the sources.

-F path

Search the (comma-separated) path for validation files. The default is /var/lcfg/conf/server/validation.

-h

If this option is present, status information, including all errors and warnings are stored for display on an HTML status page, rather than being printed to stdout. Normally, the CGI scripts status and index will be used to display this status information. The -s option can be used to automatically generate static HTML pages which do not require the CGI sripts, howver this is less flexible and results in slower compilations.

-H path

Search the (comma-separated) path for header files. The files must have an extension of .h. The default is /var/lcfg/conf/server/include,/usr/lib/lcfg/server/include.

-k

Normally, spanning maps entries are removed if the corresponding profile has compilation errors. This option specifies that any previous spanning map entries for a node are to be retained when the profile has errors.

-L lockfiles

The lockfiles argument is comma-separated list of full pathnames for lock files. In daemon mode, mkxprof will not compile source files while any of these lockfiles are non-empty; the compilation will be deferred until the next poll, or notification. This provides a mechanism to allow several synchronized changes to be made to related files, in an atomic way. The first non-empty line in the first non-empty lockfile will be displayed in the log as the reason for the lock.

-m command

A shell command to execute before starting a compilation pass, and before fetching any sources with rsync, as specified by the <F> option.

-M command

A shell command to execute before starting a compilation pass, but after fetching any sources with rsync, as specified by the <F> option.

-N fqdn

The full name of the server to be used in status displays etc. By default, this is obtained from the hostname command, but an alias may be preferred for the server name.

-o opts

Additional options for the rsync command (see option -f). This can be used, for example, to specify included, or excluded files.

-p time

When running as a daemon, this options species an interval to poll for changes to source files. It has the format: timeh|m|s[+randomh|m|s]. The random addition can be used to distribute server load.

-P path

Search the (comma-separated) path for package lists. The files must have an extension of .pkgs or .rpms. The string %r will be substituted with the value of the profile.release resource. The default is /var/lcfg/conf/server/packages.

-r

If this option is present, mkxprof adds a derivation attribute to each resource indicating the source files(s) and line number(s) at which the resource is defined.

-R

If this option is present, mkxprof rebuilds the dependency cache.

-s

This option generates static HTML pages containing status information. Normally, the -h option should be used instead.

-S path

Search the (comma-separated) path for source files. These files have no extension. The default is /var/lcfg/conf/server/source.

-v

Verbose.

-w dir

The root of the published web directory. Profiles are generated in the profiles subdirectory, and status reports are generated in the status subdirectory. The default is /var/lcfg/conf/server/web when running as root, and ./LCFG when running as any other user.

-W flags

This option enables warnings for the categories listed by the comma-separated list of flags. Possible flags are ack, ambiguous, cache, client, components, context, files, mutate, ref. Flags may be prefixed with + or - to enable/disable specific categories.

-x file

Write statistics records to the named file. For each compilation pass, a colon-separated record is written with the following fields:

Unix time at start of compilation pass
Unix time at end of compilation pass
Number of ACKs received during this pass
Number of acks discarded (superseded by later ones)
Number of files examined
Number of files changed (or explicitly specified)
Number of recompiled hosts
-z default release name

The name for the default release name which will be used if no release is specified in a source profile. If this option is not specified then the default release name is 'default'.

SIGNALS & NOTIFICATION

When running in daemon mode, mkxprof will accept UDP notifications from clients on the service port lcfgack (default 733). These notifications contain the timestamp of the latest received profile which mkxprof will record in the status display.

A HUP signal causes the mkxprof daemon to re-examine the source files. This can be initiated remotely by ssh or by om, using the run or rebuild methods of the profile component.

An INT signal will terminate the daemon cleanly.

FILES

/var/lcfg/conf/server/cache

Contains profile caches and dependency information used internally by mkxprof.

/var/lcfg/tmp/server

Contains temporary files.

/var/lcfg/conf/server/web

Directory for profiles and status files. This directory should be published by a web server.

PLATFORMS

Redhat9, Solaris9, Fedora3

AUTHOR

Paul Anderson <dcspaul@inf.ed.ac.uk>