scanmaster -- farm scanning jobs out to hosts running scanslave
scanmaster [-Hh] [-A authmode] [-a aggregator] [-c post-chunk] [-d dir] [-j jobs] [-p pre] [-w workers] -i input -n name -r remote [-- scanslave-passthrough-args]
The scanmaster utility is part of the “scanmaster” suite of scripts. It is the primary invoking command and hence named the same. It represents the portion of the process that farms a scan job out to a number of scanning nodes, which in turn invoke scanslave(1) .
scanmaster supports the following command-line options:
Any arguments given after a -- will be treated as “scanslave passthrough" arguments. That is, they will be passed on to scanslave(1) , with the -- intact, meaning scanslave(1) will further pass them through to other tools it may invoke.
Upon invocation, scanmaster will first run the script given to the -p flag (if any), passing it the name of the scan as the single argument. It then removes any files found under the shared directory for a scan by this name, creates a new sub directory (by date), and tries to set up the environment for the currently running (if any) ssh-agent(1) . Next, it splits the input file into N chunks, where N is the number of hosts found in the worker hosts file. After that, it will ssh to each worker host, create a screenrc file that will invoke scanslave(1) with the appropriate options; it then invokes screen(1) with a key-binding of ^Ww. The user needs to detach from each host’s screen session in order to let scanmaster move on to the next host.
After all hosts have started a screen session, scanmaster will wait for the scanning nodes to complete their respective jobs. Once every minute, scanmaster will look for the existence of a file called “.done” which is created in the well-defined shared location by scanslave(1) . When it finds all “.done” files, it will execute the script given via the a flag (if any), passing it the name of the scan as the first argument and the location of the original input file as the second argument.
scanmaster uses the following environment variables:
env ${SCAN_ENV} scanslave other-args This allows the user to pass anything into the environment of the invoked processes on the scanslave hosts. Obviously, SCAN_ENV should then contain key=value pairs.
The following examples illustrate common usage of this tool.
SCAN=info1
PREFIX=/mnt/scanmaster/jschauma/${SCAN}
autopw(1) , checkhosts(1) , scanhosts(1) , scanslave(1) , tkill(1)
The scanmaster utility was originally written by Jan Schaumann <jschauma@yahoo-inc.com> in July 2007 as “cmd.chunker".
Please report bugs and feature requests to the author.