Skip to content

Conversation

@iversond
Copy link
Contributor

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

@iversond iversond requested a review from kbens June 16, 2023 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants