Skip to content

Commit

Permalink
control_cli.rb - all normal output should be to @stdout (puma#2487)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Nov 17, 2020
1 parent ae01730 commit a7c931a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

* Bugfixes
* Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
* control_cli.rb - all normal output should be to @stdout (#2487)
* Catch 'Error in reactor loop escaped: mode not supported for this object: r' (#2477)
* Ignore Rails' reaper thread (and any thread marked forksafe) for warning ([#2475])
* Ignore illegal (by Rack spec) response header ([#2439])
Expand Down
6 changes: 3 additions & 3 deletions lib/puma/control_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def initialize(argv, stdout=STDOUT, stderr=STDERR)
end

o.on_tail("-V", "--version", "Show version") do
puts Const::PUMA_VERSION
@stdout.puts Const::PUMA_VERSION
exit
end
end
Expand Down Expand Up @@ -236,14 +236,14 @@ def send_signal
sig = CMD_PATH_SIG_MAP[@command]

if sig.nil?
puts "'#{@command}' not available via pid only"
@stdout.puts "'#{@command}' not available via pid only"
return
elsif sig.start_with? 'SIG'
Process.kill sig, @pid
elsif @command == 'status'
begin
Process.kill 0, @pid
puts 'Puma is started'
@stdout.puts 'Puma is started'
rescue Errno::ESRCH
raise 'Puma is not running'
end
Expand Down

0 comments on commit a7c931a

Please sign in to comment.