Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --host option #177

Merged
merged 2 commits into from
Apr 10, 2015
Merged
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion lib/fluentd-ui/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ class Command < Thor
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: '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
# 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


Expand Down