diff --git a/lib/fluent/supervisor.rb b/lib/fluent/supervisor.rb index c8ad426a0e..2cd0f7e166 100644 --- a/lib/fluent/supervisor.rb +++ b/lib/fluent/supervisor.rb @@ -75,6 +75,16 @@ def run_rpc_server Process.kill :TERM, $$ nil } + @rpc_server.mount_proc('/api/processes.flushBuffersAndKillWorkers') { |req, res| + $log.debug "fluentd RPC got /api/plugins.flushBuffersAndKillWorkers request" + if Fluent.windows? + $log.warn "operation 'flushBuffersAndKillWorkers' is not supported on Windows now." + else + Process.kill :USR1, $$ + Process.kill :TERM, $$ + end + nil + } @rpc_server.mount_proc('/api/plugins.flushBuffers') { |req, res| $log.debug "fluentd RPC got /api/plugins.flushBuffers request" unless Fluent.windows?