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 <[email protected]>
  • Loading branch information
ashie committed Mar 30, 2020
1 parent a593786 commit 0719e4b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,7 @@ 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)
exit s.exitstatus
Expand Down

0 comments on commit 0719e4b

Please sign in to comment.