Skip to content

Commit

Permalink
Allow to launch fluentd from C:\Program Files\
Browse files Browse the repository at this point in the history
On testing arguments in RUBYOPT, command line arguments aren't quoted so
that it will fail if ruby command (which is passed as the first
arugment) is placed under a directory which contains spaces.

Use `spawn(program, *args)` instead of `spawn(command, options={})` to
fix it.

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed Mar 30, 2020
1 parent a593786 commit eba73d9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -897,10 +897,9 @@ def build_spawn_command

# Adding `-h` so that it can avoid ruby's command blocking
# e.g. `ruby -Eascii-8bit:ascii-8bit` will block. but `ruby -Eascii-8bit:ascii-8bit -h` won't.
cmd = fluentd_spawn_cmd.join(' ')
_, e, s = Open3.capture3("#{cmd} -h")
_, e, s = Open3.capture3(*fluentd_spawn_cmd, "-h")
if s.exitstatus != 0
$log.error('Invalid option is passed to RUBYOPT', command: cmd, error: e)
$log.error('Invalid option is passed to RUBYOPT', command: fluentd_spawn_cmd, error: e)
exit s.exitstatus
end

Expand Down

0 comments on commit eba73d9

Please sign in to comment.