File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ def before_run
44
44
@rpc_server = nil
45
45
@counter = nil
46
46
47
+ @fluentd_lock_dir = Dir . mktmpdir ( "fluentd-lock-" )
48
+ ENV [ 'FLUENTD_LOCK_DIR' ] = @fluentd_lock_dir
49
+
47
50
if config [ :rpc_endpoint ]
48
51
@rpc_endpoint = config [ :rpc_endpoint ]
49
52
@enable_get_dump = config [ :enable_get_dump ]
@@ -73,9 +76,15 @@ def after_run
73
76
stop_windows_event_thread if Fluent . windows?
74
77
stop_rpc_server if @rpc_endpoint
75
78
stop_counter_server if @counter
79
+ cleanup_lock_dir
76
80
Fluent ::Supervisor . cleanup_resources
77
81
end
78
82
83
+ def cleanup_lock_dir
84
+ FileUtils . rm ( Dir . glob ( File . join ( @fluentd_lock_dir , "fluentd-*.lock" ) ) )
85
+ FileUtils . rmdir ( @fluentd_lock_dir )
86
+ end
87
+
79
88
def run_rpc_server
80
89
@rpc_server = RPC ::Server . new ( @rpc_endpoint , $log)
81
90
@@ -871,10 +880,7 @@ def supervise
871
880
Fluent ::Supervisor . load_config ( @config_path , params )
872
881
}
873
882
874
- Dir . mktmpdir ( "fluentd-lock-" ) do |lock_dir |
875
- ENV [ 'FLUENTD_LOCK_DIR' ] = lock_dir
876
- se . run
877
- end
883
+ se . run
878
884
end
879
885
880
886
def install_main_process_signal_handlers
You can’t perform that action at this time.
0 commit comments