Skip to content

Commit

Permalink
Merge pull request #1066 from fluent/pass-rubyopt
Browse files Browse the repository at this point in the history
Fix supervisor to pass RUBYOPT to worker process
  • Loading branch information
repeatedly authored Jun 28, 2016
2 parents 0afbbc4 + 395b665 commit 9a7fd33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,18 @@ def show_plugin_config
def supervise
$log.info "starting fluentd-#{Fluent::VERSION}"

rubyopt = ENV["RUBYOPT"]
if Fluent.windows?
# Shellwords doesn't work on windows, then used gsub for adapting space char instead of Shellwords
fluentd_spawn_cmd = ServerEngine.ruby_bin_path + " -Eascii-8bit:ascii-8bit "
fluentd_spawn_cmd << ' "' + rubyopt.gsub('"', '""') + '" ' if rubyopt
fluentd_spawn_cmd << ' "' + $0.gsub('"', '""') + '" '
$fluentdargv.each{|a|
fluentd_spawn_cmd << ('"' + a.gsub('"', '""') + '" ')
}
else
fluentd_spawn_cmd = ServerEngine.ruby_bin_path + " -Eascii-8bit:ascii-8bit "
fluentd_spawn_cmd << ' ' + rubyopt + ' ' if rubyopt
fluentd_spawn_cmd << $0.shellescape + ' '
$fluentdargv.each{|a|
fluentd_spawn_cmd << (a.shellescape + " ")
Expand Down

0 comments on commit 9a7fd33

Please sign in to comment.