Skip to content

Commit

Permalink
Merge pull request #1093 from fluent/fix-bug-rpc-config-reload
Browse files Browse the repository at this point in the history
Fix regression about RPC /api/config.reload
  • Loading branch information
repeatedly authored Jul 20, 2016
2 parents 85dd918 + 7246d6a commit d9cb550
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions example/in_forward.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<system>
rpc_endpoint 0.0.0.0:24444
</system>

<source>
@type forward
</source>
Expand Down
11 changes: 10 additions & 1 deletion lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,21 @@ def stop_rpc_server
end

def install_supervisor_signal_handlers
trap :HUP do
$log.debug "fluentd supervisor process get SIGHUP"
supervisor_sighup_handler
end unless Fluent.windows?

trap :USR1 do
$log.debug "fluentd supervisor process get SIGUSR1"
supervisor_sigusr1_handler
end unless Fluent.windows?
end

def supervisor_sighup_handler
kill_worker
end

def supervisor_sigusr1_handler
if log = config[:logger_initializer]
log.reopen!
Expand All @@ -136,7 +145,7 @@ def kill_worker
if Fluent.windows?
Process.kill :KILL, pid
else
Process.kill :INT, pid
Process.kill :TERM, pid
end
end
end
Expand Down

0 comments on commit d9cb550

Please sign in to comment.