Alva L. Couch > Software > Prodog > Documentation
Quick links: Contact Teaching Publications Research Software Personal Arts

Prolog System Administration Prototype Documentation

This document describes the Prolog prototype for system administration using Logic Programming. The prototype consists of: Using the prototype is easy; simply load glue.pl, which loads the C extensions and defines needed Prolog goals, then load your application program and execute a query. This can be done on the command line as documented in the SWI-Prolog manual.

Prototype Notes

This prototype is not intended to stand alone, but is only one part of a comprehensive network administration system comprising: We anticipate release of the whole system only when all pieces are in place, as we do not advocate utilizing Prolog in its raw form as a scripting language. In the prototype, to simplify coding and syntax, all string values are actually defined as weird Prolog atoms. Intrinsic strings such as "string" are not understood, while the atom 'string' is treated as if it were a string. The prototype is notably incomplete, and syntax is subject to change without notice, as we are not satisfied with the names and syntax of the principal goals. This documentation is provided simply to give the reader a flavor of what we are doing. We do not expect to release this version of the software; rather we are working on a front-end preprocessor that generates calls to this code as a result of compiling a simpler configuration language. This compiler will: The reader is advised not to count upon the goal syntaxes documented herein, as only the syntax of the simpler language will be guaranteed and documented in the final version. The syntax described herein is better characterized as an assembly language into which user queries can be compiled after type-checking and optimization!

System Identification

Several goals allow conclusive determination of the current operating environment.

Users and Groups

The following goals describe users and groups within the system, by a variety of methods, and allow mapping between name and numeric ID for each.

Network Information

The following calls are primitive interfaces to the system calls describing host addresses and other network information. Each call's results are determined by the settings in /etc/nsswitch.conf. All calls assume that the host has an IP number and are blind to other forms of addressing. Note also that stat functions had to be broken into two parts, because SWI-Prolog limits foreign functions to 10 or fewer arguments.

File handling and statistics

Several extensions provide the ability to copy, link, query, or modify the attributes of locally accessible files. Note that this does not describe file handling built into SWI-Prolog, which is described in the SWI-Prolog documentation.

File editing

A small number of the CFEngine file editing primitives have been translated into Prolog and work here (the ones we use)!

Reading files and output line-by-line

Matching and Parsing

Interfaces to specific UNIX commands

Several 'interface functions', written using the above command output and field splitting commands, are provided for ease of programming.

Interfaces to specific files

A few interfaces are provided for specific files within the UNIX filesystem that need to be commonly parsed.

Text database interface

There is a general interface that'll parse simple text databases. A database line of the form field1=value1 field2=value2 is translated to the Prolog list [field1('value1'),field2('value2')].

Process control

Contacting people


Alva L. Couch > Software > Prodog > Documentation
Quick links: Contact Teaching Publications Research Software Personal Arts