diff --git a/fluentd/Dockerfile b/fluentd/Dockerfile index 3ecb92758..9581b398f 100644 --- a/fluentd/Dockerfile +++ b/fluentd/Dockerfile @@ -66,7 +66,9 @@ RUN mv /usr/share/gems/aws-sdk-core.source0001.patch /usr/share/gems/gems/aws-s cd /usr/share/gems/gems/aws-sdk-core-*/ && patch -p1 < aws-sdk-core.source0001.patch && \ cd /usr/share/gems && \ mv /usr/share/gems/fluent-plugin-detect-exceptions.source0001.patch /usr/share/gems/gems/fluent-plugin-detect-exceptions-*/ && \ - cd /usr/share/gems/gems/fluent-plugin-detect-exceptions-*/ && patch -p1 < fluent-plugin-detect-exceptions.source0001.patch + cd /usr/share/gems/gems/fluent-plugin-detect-exceptions-*/ && patch -p1 < fluent-plugin-detect-exceptions.source0001.patch && \ + mv /usr/share/gems/fluentd.source0001.patch /usr/share/gems/gems/fluentd-*/ && \ + cd /usr/share/gems/gems/fluentd-*/ && patch -p1 < fluentd.source0001.patch RUN mkdir -p /etc/fluent/configs.d/user && \ chmod 777 /etc/fluent/configs.d/user && \ diff --git a/fluentd/fluentd.source0001.patch b/fluentd/fluentd.source0001.patch new file mode 100644 index 000000000..728c63966 --- /dev/null +++ b/fluentd/fluentd.source0001.patch @@ -0,0 +1,13 @@ +diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb +index 3ad5943f8..ac38f5eeb 100644 +--- a/lib/fluent/plugin/in_tail.rb ++++ b/lib/fluent/plugin/in_tail.rb +@@ -509,7 +509,7 @@ module Fluent::Plugin + if new_position_entry.read_inode == 0 + # When follow_inodes is true, it's not cleaned up by refresh_watcher. + # So it should be unwatched here explicitly. +- rotated_tw.unwatched = true ++ rotated_tw.unwatched = true if rotated_tw + # Make sure to delete old key, it has a different ino while the hash key is same. + @tails.delete(rotated_target_info) + @tails[new_target_info] = setup_watcher(new_target_info, new_position_entry)