This PR has a number of changes to how output from psadmin is processed. psadmin mixes messages between stdout and stderr (often with normal information in stderr). This PR now offers 3 levels of output you can choose:
PS_PSA_OUTPUT
all - the default - shows normal output like past versions
summary - only show stdout (plus a few special lines from stderr like "x processes started" but reprocessed into stdout. This will help with Rundeck and other tools to keep stderr from being polluted with informational messages.
quiet - hide all output - you can use exit codes from psa. On errors, psa will display stderr from psadmin.
There are some new environment variables to control the output behavior:
PS_PSA_TIMESTAMP
true - each line will have a timestamp prepended to it - useful with psa status tux APPDOM to output the Tuxedo Queue stats to file
false - default
PS_PSA_NO_BANNER
true - do not display the command banner - useful with the PS_PSA_OUTPUT=quiet option
false - default
PS_PSA_DEBUG
INFO - default - only display informational messages
DEBUG - display debug output including commands
The other big change is moving command execution into a new Runner class. This simplifies processing psadmin output by only having a single execution point. The runner uses Open3.popen3 to execute OS commands, and within the wait_thread we can decide how we process stdout and stderr. For summary and quiet output, we handle the output after the command has completed rather than stream stdout and stderr.
Fixes these issues: #107, #102, #71
Some changes for #88 but still didn't resolve issue
This PR has a number of changes to how output from
psadmin
is processed.psadmin
mixes messages between stdout and stderr (often with normal information in stderr). This PR now offers 3 levels of output you can choose:PS_PSA_OUTPUT
psa
. On errors,psa
will display stderr frompsadmin
.There are some new environment variables to control the output behavior:
PS_PSA_TIMESTAMP
true
- each line will have a timestamp prepended to it - useful withpsa status tux APPDOM
to output the Tuxedo Queue stats to filefalse
- defaultPS_PSA_NO_BANNER
true
- do not display the command banner - useful with thePS_PSA_OUTPUT=quiet
optionfalse
- defaultPS_PSA_DEBUG
INFO
- default - only display informational messagesDEBUG
- display debug output including commandsThe other big change is moving command execution into a new
Runner
class. This simplifies processingpsadmin
output by only having a single execution point. The runner usesOpen3.popen3
to execute OS commands, and within the wait_thread we can decide how we process stdout and stderr. Forsummary
andquiet
output, we handle the output after the command has completed rather than stream stdout and stderr.Fixes these issues: #107, #102, #71 Some changes for #88 but still didn't resolve issue