Skip to content
This repository was archived by the owner on Feb 28, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
41933f5
drafting psc/pq tux options
iversond Jun 7, 2023
e705887
Testing different command options
iversond Jun 8, 2023
fa96104
Fix typo
iversond Jun 8, 2023
bc18efe
Fix typo
iversond Jun 8, 2023
bf6aa23
Capture output for processing in ruby
iversond Jun 13, 2023
cf74566
Setting TUXCONFIG inline
iversond Jun 13, 2023
a37cebe
exporting PSTUXCONFIG
iversond Jun 13, 2023
0c3c951
Prefix tux output with timestamp
iversond Jun 13, 2023
df28e66
Split newlines
iversond Jun 13, 2023
2f54afc
Create array from string
iversond Jun 13, 2023
5fab0f5
Fix typo
iversond Jun 13, 2023
fcc3453
Testing line array
iversond Jun 13, 2023
8d81348
Capture only first line
iversond Jun 13, 2023
d5500d9
Test line object
iversond Jun 13, 2023
3d8a12c
Correctly splitting new lines
iversond Jun 13, 2023
823e5e8
Breaking things by trying Open3.capture3 for timestamps
iversond Jun 13, 2023
f6483ee
Hiding timestamps for internal calls
iversond Jun 13, 2023
499eee4
Remove quotes
iversond Jun 13, 2023
a80e3d2
Checking for empty lines
iversond Jun 13, 2023
e785cf4
Add timestamp to banner
iversond Jun 13, 2023
cfd5f49
Fix banner timestamp
iversond Jun 13, 2023
fe4390e
Remove > lines
iversond Jun 13, 2023
d2cb023
Remove > lines
iversond Jun 13, 2023
e2b01ae
Using chomp to remove quotes
iversond Jun 13, 2023
d348226
Using tr to remove quotes
iversond Jun 13, 2023
28ea60b
Using tr to remove quotes
iversond Jun 13, 2023
4845661
Using gsub to remove quotes
iversond Jun 13, 2023
4a67cdd
Moving output handling to it's own method
iversond Jun 13, 2023
9cd638b
Trying merged stdout/sterr
iversond Jun 13, 2023
fce2a87
Testing additional logging for each line
iversond Jun 13, 2023
a8fd1c4
Removing test logging
iversond Jun 13, 2023
83e1fc9
Simplify timestamp code
iversond Jun 14, 2023
8a523d5
Don't process internal call stdout
iversond Jun 14, 2023
dc90287
Forcing tux opts to an array
iversond Jun 14, 2023
e9c72dd
Forcing tux opts to an array
iversond Jun 14, 2023
9efec8b
Only using pq for tux status
iversond Jun 14, 2023
3ffacd2
Only using pq for tux status
iversond Jun 14, 2023
1e773f4
Trying colors for stderr
iversond Jun 14, 2023
72cb97a
Send stderr
iversond Jun 14, 2023
b7a3e45
Testing a runner class to stream stdout
iversond Jun 14, 2023
21a886a
Use require_relative
iversond Jun 14, 2023
9504345
Use runner.stdout
iversond Jun 14, 2023
7723f49
Starting output processing
iversond Jun 14, 2023
71111db
Fix typo
iversond Jun 14, 2023
03ba509
Fix typo
iversond Jun 14, 2023
eb6eac3
Fix typo
iversond Jun 14, 2023
bbe3e02
Testing a realtime flag for streaming stdout
iversond Jun 14, 2023
5fd825f
Initialize realtime
iversond Jun 14, 2023
2357144
Setting realtime when instantiating
iversond Jun 14, 2023
a667bbc
Support realtime in init
iversond Jun 14, 2023
ac5affa
Testing new debugger
iversond Jun 14, 2023
ac8a862
Reverting runner code
iversond Jun 14, 2023
cd42afc
Try logger module
iversond Jun 14, 2023
36a100f
Add missing end
iversond Jun 14, 2023
94576a9
Include logging module
iversond Jun 14, 2023
e95c9da
Testing instance references
iversond Jun 14, 2023
9f47dc1
Testing module reference
iversond Jun 14, 2023
7d042e1
Moving method defs to main file
iversond Jun 14, 2023
0e8b900
Testing simpler logger
iversond Jun 14, 2023
d6c01d6
Use method call
iversond Jun 14, 2023
34e6789
Simple names for logging
iversond Jun 14, 2023
0fb2cc8
Move logger init to psa
iversond Jun 14, 2023
c3f7440
Testing with module for psadmin_plus
iversond Jun 14, 2023
3974a62
Fix module name
iversond Jun 14, 2023
0f9313a
Using RUBY_PLATFORM for os
iversond Jun 14, 2023
8895196
Change env( to ENV(
iversond Jun 14, 2023
a7c1e33
Starting ENV chagnes
iversond Jun 14, 2023
a512b19
Switch back to 'os'
iversond Jun 14, 2023
461957a
Add modulename to os call
iversond Jun 14, 2023
0f0740f
Fix module name
iversond Jun 14, 2023
d5f6c85
Playing with a new psa class
iversond Jun 14, 2023
3a6b401
Fix typo
iversond Jun 14, 2023
4ca6a1b
Fix typo
iversond Jun 14, 2023
cedfe2d
Change object init
iversond Jun 14, 2023
f8c6454
Remove class - use include
iversond Jun 14, 2023
b14cfc5
Remove psa prefix
iversond Jun 14, 2023
0b20e57
Change ENV back to env
iversond Jun 14, 2023
60d2fed
Testing module-level vars
iversond Jun 14, 2023
c7e5126
Fix syntax for module vars
iversond Jun 14, 2023
5263d0f
Missing @@
iversond Jun 14, 2023
3056659
Try encoding stars
iversond Jun 14, 2023
53ef471
Use utf-8
iversond Jun 14, 2023
8b2d8da
Disable print for psadmin_check
iversond Jun 14, 2023
9f933a8
Fixing internal calls to do_cmd
iversond Jun 14, 2023
497c178
Set logger level from PS_PSA_DEBUG
iversond Jun 14, 2023
c3a6c1f
starting output types
iversond Jun 14, 2023
e4802e3
Adding check for summary output
iversond Jun 14, 2023
918d300
Testing output level in runner
iversond Jun 14, 2023
177f23d
Method for printing stdout/stderr
iversond Jun 14, 2023
d2d8742
Checking exitcode boolean
iversond Jun 14, 2023
7c69cc5
Remove success message
iversond Jun 14, 2023
e457780
Move exitcode check to output-based calls only
iversond Jun 14, 2023
6f6bd86
Moving output processing around a bit
iversond Jun 14, 2023
cf951b3
fix object reference
iversond Jun 14, 2023
6804058
Add error 40 as OK
iversond Jun 14, 2023
66927fb
Removing timestamps from logger
iversond Jun 15, 2023
c10def2
Testing output handling in runner
iversond Jun 15, 2023
5e56e49
Set logger level first for class var
iversond Jun 15, 2023
a287554
Use instance vars
iversond Jun 15, 2023
765da27
Try to capture start/stop messages
iversond Jun 15, 2023
608c01d
Capture single process start
iversond Jun 15, 2023
09ddae1
Use single call with platform prefix/suffix
iversond Jun 15, 2023
4f44ce6
Include pre/suff in command
iversond Jun 15, 2023
c4f37d6
Unicode chars
iversond Jun 15, 2023
c92bab6
Try encoding stars
iversond Jun 15, 2023
75fda7a
Remov encoding
iversond Jun 15, 2023
1c9f028
Encode just that char
iversond Jun 15, 2023
e69eb85
Force encoding
iversond Jun 15, 2023
660489f
Change debug to yellow
iversond Jun 15, 2023
b7a74d4
Change coloring to match bash template
iversond Jun 15, 2023
759f55b
Change coloring to match bash template
iversond Jun 15, 2023
bec97cd
Command banner to use INFO
iversond Jun 15, 2023
131bd37
Remove unicode chars
iversond Jun 15, 2023
81148b5
Add more consts to list
iversond Jun 15, 2023
e583bca
Cleaning up timestamp code
iversond Jun 15, 2023
6cbbf15
On quiet - no output unless error
iversond Jun 15, 2023
cad96c9
Set banner back to default
iversond Jun 15, 2023
7a057df
No timestamp for list
iversond Jun 15, 2023
ac3bc4e
Named params for list
iversond Jun 15, 2023
a8b17e7
Fix list alignment
iversond Jun 15, 2023
bba1108
Change output to all for default. Summary and quiet are optional
iversond Jun 15, 2023
f4e3e3c
Adding debug
iversond Jun 15, 2023
376f3f4
Mucking with internal calls again
iversond Jun 15, 2023
e81cbf3
Named params for list
iversond Jun 15, 2023
6e9aa2f
Named params for list
iversond Jun 15, 2023
aaecab4
Trying named params
iversond Jun 15, 2023
eedf7fd
More named params
iversond Jun 15, 2023
48509f1
Set cmd: param name
iversond Jun 15, 2023
70a6423
Set cmd: param name
iversond Jun 15, 2023
74b628c
Finetine internal output
iversond Jun 15, 2023
f05f21d
Finetine internal output
iversond Jun 15, 2023
b318903
Finetine internal output
iversond Jun 15, 2023
c7a4905
Add no banner env
iversond Jun 15, 2023
111cc97
Add no banner env
iversond Jun 15, 2023
c9029c4
Add misssing cmd:
iversond Jun 15, 2023
54e2c41
Remove ps flag
iversond Jun 15, 2023
a7c1cdc
Remove ps flag
iversond Jun 16, 2023
0047529
Adding os-specific join commands
iversond Jun 16, 2023
a21a4c0
Testing instance vars
iversond Jun 16, 2023
088509c
Using method
iversond Jun 16, 2023
1d6905f
Using contasnts
iversond Jun 16, 2023
d19958b
moving constant init
iversond Jun 16, 2023
1cdb385
Remove extra timestamp param
iversond Jun 16, 2023
076998a
Fixing tux commands on windows
iversond Jun 16, 2023
dde7cc8
Fixing tux commands on windows
iversond Jun 16, 2023
d979df9
Testing cmd /c for tux stats
iversond Jun 16, 2023
1332878
Forgot c
iversond Jun 16, 2023
448626a
Add echo
iversond Jun 16, 2023
667fac2
Remove dot
iversond Jun 16, 2023
6850c84
Change envs for cmd
iversond Jun 16, 2023
e7822e6
Add powershell flag back to do_cmd
iversond Jun 16, 2023
fd7b920
Switch path separator
iversond Jun 16, 2023
b06a8bb
Enable debug for now
iversond Jun 16, 2023
72cc25d
Quote cmd /c commands
iversond Jun 16, 2023
2e49e52
Punting on windows support for tux/pubsub for now
iversond Jun 16, 2023
ad46b10
Adding bash test script
iversond Jun 16, 2023
1c9284c
Adding bash test script
iversond Jun 16, 2023
228a9ac
Add powershell test script
iversond Jun 16, 2023
b140527
Add env var tests
iversond Jun 16, 2023
509f137
loop through env var tests
iversond Jun 16, 2023
ebb3398
Windows - web - use cmd
iversond Jun 16, 2023
51e657b
Remove dup cmd /c
iversond Jun 16, 2023
b455762
change windows psadmin path
iversond Jun 16, 2023
90bb6c0
Add shutdown for pubsub
iversond Jun 16, 2023
4533a7b
Fix PS_PSA_TIMESTAMP typo:
iversond Jun 16, 2023
61c75c7
Full paths for tmadmin
iversond Jun 16, 2023
c9fd11e
Revert for TUXDIR
iversond Jun 16, 2023
2dbf2c4
Change tmadmin call for start/stop
iversond Jun 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ Environment variables are used to control `psadmin-plus` and `psadmin` functiona
* Sets the hook script to run before the `stop` command and after the `start` command.
* Examples are found in `lib/hooks`.
* If not set, default is `false` and no hook is triggered.
* `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`.
* `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

## Configuration File

Expand Down
35 changes: 22 additions & 13 deletions bin/psa
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#!/usr/bin/env ruby

begin
require 'psadmin_plus'
require 'psadmin_plus'
rescue LoadError
# running directly, not through gem install
require_relative '../lib/psadmin_plus.rb'
# running directly, not through gem install
require_relative '../lib/psadmin_plus.rb'
end

include PsadminPlus

# options
opts_c = ARGV.shift || "help"
opts_t = ARGV.shift || "all"
opts_d = ARGV.shift || "all"
# Set remaining arguments as environment variables
ARGV.each do |arg|
if arg.include? "="
var = arg.split('=')
ENV[var[0]]=var[1]
puts "Setting environment variable " + var[0] + "=" + var[1]
else
# puts "Skip argument, no valid environment variable found."
end
if arg.include? "="
var = arg.split('=')
ENV[var[0]]=var[1]
puts "Setting environment variable " + var[0] + "=" + var[1]
else
# puts "Skip argument, no valid environment variable found."
end
end

commands = opts_c.split(',')
Expand Down Expand Up @@ -51,14 +53,19 @@ PS_HOOK_POST = ENV['PS_HOOK_POST'] || "false"
PS_HOOK_START = ENV['PS_HOOK_START'] || "false"
PS_HOOK_STOP = ENV['PS_HOOK_STOP'] || "false"
PS_PSA_SUDO = ENV['PS_PSA_SUDO'] || "on"
PS_PSADMIN_PATH = "#{OS_CONST}" == "linux" ? "#{env('PS_HOME')}/bin" : "cmd /c #{env('PS_HOME')}/appserv"
PS_PSADMIN_PATH = "#{OS_CONST}" == "linux" ? "#{env('PS_HOME')}/bin" : "#{ENV['PS_HOME']}/appserv"
PS_WIN_SERVICES = ENV['PS_WIN_SERVICES'] || "false"
PS_TRAIL_SERVICE = ENV['PS_TRAIL_SERVICE'] || "false"
PS_MULTI_HOME = ENV['PS_MULTI_HOME'] || "false"
PS_MULTI_DELIMIT = ENV['PS_MULTI_DELIMIT'] || "/"
PS_MULTI_PREFIX = ENV['PS_MULTI_PREFIX'].to_i || 0
PS_PARALLEL_BOOT = ENV['PS_PARALLEL_BOOT'] || "false"
PS_PSA_DEBUG = ENV['PS_PSA_DEBUG'] || "false"
PS_PSA_DEBUG = ENV['PS_PSA_DEBUG'] || "INFO"
PS_PSA_TIMESTAMP = ENV['PS_PSA_TIMESTAMP'] || "false"
PS_PSA_OUTPUT = ENV['PS_PSA_OUTPUT'] || "all" # values are "all", "summary", "quiet"
PS_PSA_NO_BANNER = ENV['PS_PSA_NO_BANNER'] || "false"
OS_JOIN = "#{OS_CONST}" == "linux" ? "&&" : ";"
OS_SETENV = "#{OS_CONST}" == "linux" ? "export " : "$env:"

# validation
# check runtime user
Expand All @@ -68,7 +75,7 @@ if "#{OS_CONST}" == "linux" then
exit
end
else
# windows - TODO
# nothing
end

# process
Expand All @@ -90,6 +97,8 @@ commands.each do |c|
case "#{t}"
when "app"
valid_domains = find_apps
when "tux"
valid_domains = find_apps
when "pubsub"
valid_domains = find_apps # TODO - find only apps with PUBSUB enabled?
when "prcs"
Expand Down
Loading