diff --git a/History.md b/History.md index e076b87175..159b889dca 100644 --- a/History.md +++ b/History.md @@ -10,6 +10,7 @@ * Bugfixes * Your bugfix goes here (#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]) diff --git a/lib/puma/control_cli.rb b/lib/puma/control_cli.rb index ed7ad1d26b..e2a5e59319 100644 --- a/lib/puma/control_cli.rb +++ b/lib/puma/control_cli.rb @@ -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 @@ -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