 |
In 1975, Tom Duff, Academy Award winner and inventor of Duff's device,
said that the most interesting programs were those that wrote or ran
other programs.
He should find this section interesting indeed as
qremote, cush, lash, and josh are all
programs that run other programs, often each other, to facilitate
launching programs with the correct environment and controls.
envset does not fit into this class directly, except
that its semantics are duplicated internally by the other programs.
The reader should read the brief descriptions in
Appendix D for these programs.
Briefly,
cush | could (could not) use shell interface
cush runs its argument command in the specified directory
with I/O redirection, environmental settings (possibly using a
envset environment set) specified via options.
Note that cush is invoked by qremote to actually run the
latter program's argument command.
|
envset | output environment setting commands
envset is the direct interface to the database specified in the
user's /.qtree/envset.cf and the system
<qtree>/{data,lib}/envset.cf which specifies sets of the setting and
unsetting of environment variables, shell variables, aliases,
and functions.
envset sets are used by cush and qremote.
A tree's root.vrs file's QremoteEnv setting is actually the
name of an envset set to be used when doing a qremote
in the tree.
|
josh | a job shell
josh interprets command sets selected by argument names from the
user's /.qtree/josh database, which becomes a convenient
place to store commonly used commands that do not merit file
of their own.
|
lash | long argument list shell interface
lash runs its argument command with substitutions in that command
from either lash's argument list or the standard input.
|
qremote | run a command on a remote host (if necessary)
qremote runs rsh or some equivalent to execute a command
on a remote or the local system.
qremote can accept a qdsrv path number argument that specifies
in what directory the command is to be run.
Furthermore, by default
it uses the BuildHost setting in the tree's root.vrs file
as the name of the host on which to run.
|
Note: | qremote needs to know the location of the Q-Tree on the
remote host.
This is done by sending a message to qhost which indicates the
host is up and returns the Q-Tree path and the user's login directory
See Chapter 6.5: The Qhost Server.
|
These programs are presented here as some build masters
use them in combination to manage the builds of many products across
many platforms using simple one line commands.
The Cook's Tour: Envset, Cush, ... page
illustrates their use to accomplish this in some detail.
Briefly, the user adds commands to his/her /.qtree/josh file
similar to the following:
paths = 585 588 613
goproj6: ! run detached builds for proj6
lash -o 'qremote -g -%1 qef -d @D @*' @(paths)
When the user invokes the command:
% josh -Ddir goproj6 - other args
josh will select from its database the goproj6 set,
replace the "@D" by the D argument, the "@*" by
other args, and the "@(paths)" by "585 588 613",
and then run the resulting command:
lash -o 'qremote -g -%1 qef -d dir other args' 585 588 613
lash will then run its argument command once for each argument,
replacing the "%1" by the argument, thus lash executes:
% qremote -g -585 qef -d dir other args
% qremote -g -588 qef -d dir other args
% qremote -g -613 qef -d dir other args
Considering the first of the above, qremote will chdir to the
specified path (i.e., 585), and extract that directory's settings for
BuildHost and QremoteEnv.
It then retrieves the Q-Tree for the specified host from qdsrv,
and given the host is not the current host, executes:
% rsh host host-qtree/bin/cush -Q -E qremote-env
-r pathdir go -d qef -d dir other args
If the command is to be run on the local host, the rsh host
is not included.
Note: | The rsh used is whatever the command should be
for the current host or a shell command called host in the user's
/.qtree/qremote, or the system's
<qtree>/data/qremote directories. |
Note: | The Q flag specifies that cush should set $QTREE
to host-qtree. |
Note: | qremote translates the pathdir argument to the form
used on the target host as might be necessary if the current
host is a windows system whereas the target host is unix. |
Note: | The go command will detach its argument command
after redirecting the standard outputs to a diagnostic file as
described in the next section. |
So, josh begets lash, and lash begets qremotes, and qremotes
beget rshs, and rshs beget cushs, and cushs beget
gos, and gos beget qefs and qefs
beget a multitude of other processes (often in parallel)
and you can watch it all happening with the various go-file monitors.
I wonder if Tom finds that interesting.
Note: | The other users on your network might find it offensive
and you might consider added m1 to the qef arguments
to suppress parallel execution. |
|