mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-06 03:16:11 +02:00
Merge pull request #99 from fluent/customizable_rackup
Workaround for start-stop-daemon with --exec option killing me
This commit is contained in:
commit
801c6cf925
@ -1,3 +1,6 @@
|
||||
require "active_support"
|
||||
require "active_support/core_ext"
|
||||
|
||||
module FluentdUI
|
||||
class Command < Thor
|
||||
ROOT = File.expand_path('../../../', __FILE__)
|
||||
@ -9,7 +12,11 @@ module FluentdUI
|
||||
option :daemonize, type: :boolean, default: false
|
||||
def start
|
||||
trap(:INT) { puts "\nStopping..." }
|
||||
system(*%W(bundle exec rackup #{options[:daemonize] ? "-D" : ""} --pid #{options[:pidfile]} -p #{options[:port]} -E production #{ROOT}/config.ru))
|
||||
# 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))
|
||||
end
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user