From 383be3b27bcdadf904d15b9285a5363e5067d2ac Mon Sep 17 00:00:00 2001 From: Koichi TANAKA Date: Thu, 9 Apr 2015 19:28:13 +0900 Subject: [PATCH 1/2] Add `--host` option --- lib/fluentd-ui/command.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/fluentd-ui/command.rb b/lib/fluentd-ui/command.rb index 3a64398..5bdfbc5 100644 --- a/lib/fluentd-ui/command.rb +++ b/lib/fluentd-ui/command.rb @@ -10,13 +10,14 @@ module FluentdUI option :port, type: :numeric, default: 9292 option :pidfile, type: :string, default: File.expand_path('tmp/fluentd-ui.pid', ROOT) option :daemonize, type: :boolean, default: false + option :host, type: :string, default: 'localhost' def start trap(:INT) { puts "\nStopping..." } # NOTE: on Debian based distributions, td-agent uses start-stop-daemon with --exec option for stopping process # then fluentd-ui will be killed by them because given --exec option matches. # FLUENTD_UI_EXEC_COMMAND is used for workaround it. cmd = ENV['FLUENTD_UI_EXEC_COMMAND'].presence || "rackup" - system(* %w(bundle exec) + cmd.split(" ") + %W(#{options[:daemonize] ? "-D" : ""} --pid #{options[:pidfile]} -p #{options[:port]} -E production #{ROOT}/config.ru)) + system(* %w(bundle exec) + cmd.split(" ") + %W(#{options[:daemonize] ? "-D" : ""} --pid #{options[:pidfile]} -p #{options[:port]} --host #{options[:host]} -E production #{ROOT}/config.ru)) end From 86acdca42d0e92b275302f0ebf63aea802614e3d Mon Sep 17 00:00:00 2001 From: Koichi TANAKA Date: Thu, 9 Apr 2015 19:37:26 +0900 Subject: [PATCH 2/2] Set default host to `0.0.0.0` for backward compatibility --- lib/fluentd-ui/command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluentd-ui/command.rb b/lib/fluentd-ui/command.rb index 5bdfbc5..8bf9768 100644 --- a/lib/fluentd-ui/command.rb +++ b/lib/fluentd-ui/command.rb @@ -10,7 +10,7 @@ module FluentdUI option :port, type: :numeric, default: 9292 option :pidfile, type: :string, default: File.expand_path('tmp/fluentd-ui.pid', ROOT) option :daemonize, type: :boolean, default: false - option :host, type: :string, default: 'localhost' + option :host, type: :string, default: '0.0.0.0' def start trap(:INT) { puts "\nStopping..." } # NOTE: on Debian based distributions, td-agent uses start-stop-daemon with --exec option for stopping process