|
NAMEltp-pan - A light-weight driver to run tests and clean up their pgrpsSYNOPSISltp-pan -n tagname [-SyAehp] [-t #s|m|h|d time] [-s starts] [-x nactive] [-l logfile] [ -a active-file] [-f command-file] [-d debug-level] [-o output-file] [-O buffer_directory ] [-r report_type] [-C fail-command-file] [cmd]DESCRIPTIONPan will run a command, as specified on the commandline, or collection of commands from a command-file. By default ltp-pan runs one command, choosing it at random from the whole set of commands available to it. The ltp-pan's name in the active file is specified by the tagname. When a command terminates ltp-pan will kill any orphans that may have been left behind in its pgrp. If ltp-pan is signaled it will kill any active commands and, again, clean up any orphans.Pan uses the signal ratchet found in other zoo tools. The first time ltp-pan is signaled it sends a SIGTERM to the active pgrps; the second time it sends SIGHUP; the third time a SIGINT; after that it always sends SIGKILL. Pan will not terminate until all the active commands and everything in their pgrps is dead. It will loop around at 5 second intervals, triggering its own signal ratchet, until it succeeds in killing the pgrps. When the ltp-pan starts up it places its own tagname and commandline in the active file and begins scheduling commands. After a command is started ltp-pan puts an entry for it into the active file with its indicated tagname. If the command was specified on the command line, rather than in the command-file, then its tagname will be "cmdln". When a process terminates ltp-pan frees the active file entry. If a command terminates and leaves an orphaned pgrp then ltp-pan will put an entry into the active file called "panorphan" which will be removed only when the orphaned pgrp is cleaned up. Before ltp-pan exits it will ensure that all orphaned pgrps are dead (see above) and then it will remove its own tagname from the active file. The command-file is a file containing tag/command pairs. Each line in the file begins with a tag identifying the command, followed by white space, and then the command and its arguments. A line beginning with the # character is a comment. Pan recognizes the token "%f" in a command's arguments and replaces it with a unique identifier--add this to filename arguments to prevent two instances of the command from interfering with each other. When ltp-pan receives a SIGUSR2 it stops scheduling new tests and waits for the active tests to terminate. If the -y option was used then it will begin scheduling again, otherwise it will exit. It does not propagate the SIGUSR2.
EXAMPLESIn practice, the ZOO environment variable is generally prefered over the -a option. All examples assume this is being set.The following creates a ltp-pan named "ex1" with an active file in /tmp/active. It runs the command "echo hello", keeping 3 copies running at all times, running 10 copies before terminating. $ export ZOO=/tmp
The next example will use this command file. Call this /tmp/cmds1.
Using the above command file, /tmp/cmds1, run one command at a time, sequentially, running each command only once. If one command should fail then terminate immediately. An exit log is kept for all the commands. $ ltp-pan -n ex3 -S -A -f /tmp/cmds1 -l ex3.log Here is just a simple stress case. In this case the test will run for 24 hours, printing the output as a human readable format, with the test output at /tmp/output-file and all failed test commands (if you have any) at /tmp/fail-command-file. $ ltp-pan -n stress -e -p -q -S -t 24h -a stress -l logfile -f command-file -o /tmp/output-file -C /tmp/fail-command-file LAYERINGPan is often used in layers. This section extends the above examples to show how this is done.The next example will use this command file. Call this /tmp/cmds2.
Note that the embedded ltp-pans inside this file have exit logs, and that %f
is used to give each ltp-pan a unique log file name.
The following will run commands from the command file, keeping two at a time running, choosing them sequentially, and terminating if any of them exits non-zero. $ ltp-pan -n ex4 -x2 -A -S -f /tmp/cmds2 Now run the commands in /tmp/cmds2, but this time we want to recover if one of the commands should exit non-zero. In this example it is possible for the "larry" or "curly" tags to exit non-zero. When this happens the ltp-pan will kill all active tags, making sure both larry and curly are dead, and then will continue scheduling--ensuring that our "done here" message comes out no matter what. $ ltp-pan -n ex5 -x2 -A -S -y -f /tmp/cmds2 ENVIRONMENT
FILES
SEE ALSOZoo tools - ltp-bump(1)DIAGNOSTICSBy default it exits zero unless signaled, regardless of the exit status of any of the commands it is running. If -A or -e are specified it exits non-zero if it is signaled or if any of the commands it is running should exit non-zero.
Visit the GSP FreeBSD Man Page Interface. |