Skip to content

Commit

Permalink
Merge pull request #1536 from iantalarico/fix-path-with-spaces
Browse files Browse the repository at this point in the history
Quote the file path to the Ruby bin directory when starting fluentd as a windows service
  • Loading branch information
repeatedly authored Apr 19, 2017
2 parents 161e170 + 8e2c38f commit 2ac070c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/fluent/command/fluentd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
description: FLUENTD_WINSVC_DESC,
start_type: start_type,
error_control: Service::ERROR_NORMAL,
binary_path_name: ruby_path+" -C "+binary_path+" winsvc.rb",
binary_path_name: "\"#{ruby_path}\" -C \"#{binary_path}\" winsvc.rb",
load_order_group: "",
dependencies: [""],
display_name: FLUENTD_WINSVC_DISPLAYNAME
Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/winsvc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def service_main_start
ruby_path = ruby_path.rstrip.gsub(/\\/, '/')
rubybin_dir = ruby_path[0, ruby_path.rindex("/")]
opt = read_fluentdopt
Process.spawn(rubybin_dir + "/ruby.exe " + rubybin_dir + "/fluentd " + opt + " -x " + INTEVENTOBJ_NAME)
Process.spawn("\"#{rubybin_dir}/ruby.exe\" \"#{rubybin_dir}/fluentd\" #{opt} -x #{INTEVENTOBJ_NAME}")
end

class FluentdService < Daemon
Expand Down

0 comments on commit 2ac070c

Please sign in to comment.