Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def initialize
@shutdown_start_time = nil
@metrics = nil
@startup = true
@capability = Fluent::Capability.new(:current_process)
Comment thread
Watson1978 marked this conversation as resolved.
end

desc 'The paths to read. Multiple paths can be specified, separated by comma.'
Expand Down Expand Up @@ -195,7 +196,6 @@ def configure(conf)
@dir_perm = system_config.dir_permission || Fluent::DEFAULT_DIR_PERMISSION
# parser is already created by parser helper
@parser = parser_create(usage: parser_config['usage'] || @parser_configs.first.usage)
@capability = Fluent::Capability.new(:current_process)
if @read_bytes_limit_per_second > 0
if !@enable_watch_timer
raise Fluent::ConfigError, "Need to enable watch timer when using log throttling feature"
Expand Down
16 changes: 16 additions & 0 deletions test/plugin/test_in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2648,6 +2648,22 @@ def test_no_warn_with_directory_permission
end
end

def test_other_user_owned_files
Comment thread
ashie marked this conversation as resolved.
# https://github.com/fluent/fluentd/issues/5141
omit "Cannot test with root user" if Process::UID.eid == 0
omit "NTFS doesn't support UNIX like permissions" if Fluent.windows?

config = config_element('', '', {
'tag' => "tail",
'path' => "/var/log/*.log",
'format' => 'none',
"pos_file" => "#{@tmp_dir}/tail.pos",
})
assert_nothing_raised do
create_driver(config, false)
end
end

def test_shutdown_timeout
Fluent::FileWrapper.open("#{@tmp_dir}/tail.txt", "wb") do |f|
# Should be large enough to take too long time to consume
Expand Down