Envctrl 1.4.1
The envctrl package provides some simple tools that allow a user to invoke
a shell command in a very tightly controlled environment. The user specifies
an environment profile, umask, directory, and host on which the command is
invoked (as well as the command itself, of course). The primary group may
also be set. If the user is the super-user, then a different identity may
be set when invoking the command as well.
One of the applications of this script is to provide a reproducible
environment for building software in a development effort. Environment
profiles may be saved with the source code of the product and used during
the build to more easily restore the proper environment for old builds
undergoing maintenance.
The environment profile sets up resources for the command to use, and also
tears them down after the command completes. Such resources may include
the setting of environment variables, the creation of workspaces and data
files, and starting up new services. (It is the responsibility of the
profile to manage resources so that concurrent invocations of the profile
do not interfere with one another.) The environment profile is a Bourne
Shell script.
The envctrl program can also unset any environment variables that are not
known to the profile. This prevents the user's environment from having
unexpected interactions with unknown or undocumented features of the shell
command that the envctrl program invokes.
Predefined, named configurations can be specified in a configuration file.
This is useful for maintaining scripts that might use the envctrl program,
to simplify maintenance.
The envctrl package includes the envctrl program itself, a sample environment
profile that mimics a crontab environment on NetBSD, Solaris, and HP-UX, and
an auxiliary program that unsets all unknown environment variables.
The scripts run on Windows NT with the MKS toolkit installed, and a batch
script wrapper is also included.
Manuals are provided, in the form of Unix man pages.
The envctrl program requires standard Unix utilities to run properly, plus
Paul Smith's newgrpcmd program (which is available elsewhere on this site).
To install this tool, copy the envctrl, envclean, and env.cron scripts to any
convenient location, and make them executable. (The envctrl and envclean
scripts must be placed in the same directory.) Note that a minor edit to the
envctrl script may be necessary in the event that the Berkeley remote shell
program is named "remsh" rather than "rsh". Copy the .man files to the shared
manual directory, formatting them with Nroff (with the -man macros) as needed.
If running on Windows, copy envctrl.bat to the same directory as the envctrl
script.
This software is donated to the public domain by its author, Paul Sander
(paul@wakawaka.com).
History:
1.4.1 -- Debugged quoting problems and a few other minor things. Also
changed the setgid feature to use newgrpcmd rather than newgrp,
to allow piping of the stdin stream to the spawned command.
1.4 -- Added support for predefined, named, configurations.
1.3 -- Ported to Windows NT.
1.2 -- Ported to HP-UX and Solaris.
1.1 -- Added manuals.
1.0 -- Initial release, undocumented.
Name Last modified Size Description
Parent Directory 13-Aug-2005 12:37 -
envctrl.tar.Z 13-Aug-2005 12:36 13k
Apache/1.3.33 Server at zul.wakawaka.com Port 80