sous-chefs / rsyslog

Development repository for the rsyslog cookbook
https://supermarket.chef.io/cookbooks/rsyslog
Apache License 2.0
65 stars 199 forks source link

Removed $ModLoad imfile from rsyslog_file_input resource #151

Closed runswithd6s closed 4 years ago

runswithd6s commented 5 years ago

In order use the rsyslog_file_input resource, $ModLoad imfile needs to be defined only once. Removed it from the file-input.conf.erb template file and added README.md instructions to add the imfile module to the node to enable. Added tests for a second log file and for existence of one module load statement.

Description

The file_input resource was incorrectly including the legacy $ModLoad imfile declaration in each new config file created from template. Additionally, the legacy style script prevented newer rsyslog daemons from using inotify method. This commit adds:

Issues Resolved

Fixed #119.

Check List

runswithd6s commented 5 years ago

As simple as this approach is to implement, it's not simple to test. When overriding node attributes in kitchen.yml, I get conflicting states for CentOS 6 and CentOS 7 hosts (or really the difference between hosts that use imklog and those that use imjournal). To make testing easier, and also introduce Rainer script for specifying imfile attributes, I'm going to introduce a new node attribute: use_imfile.

runswithd6s commented 5 years ago

(Note: there are some SmartOS test failures that should probably get fixed outside the scope of this PR.)

runswithd6s commented 5 years ago

@tas50, @jtimberman This pull request is ready for review. All tests are passing, and DCO signed-off-by is completed. Please let me know if you'd like anything changed.

runswithd6s commented 5 years ago

@tas50, @jtimberman I took out the feature-flag requirement for this update and instead built the 35-imfile.conf template whenever the rsyslog_file_input resource was defined. This makes the integration simpler and behave as one would expect. Are either of you ready for a code-review?

Vasu1105 commented 4 years ago

@tas50 I have verified this PR from my side and it LGTM.

Vasu1105 commented 4 years ago

@runswithd6s you need to reabse this branch.

runswithd6s commented 4 years ago

@Vasu1105 I can close this one and re-open from a personal fork https://github.com/runswithd6s/chef-rsyslog/tree/bug-119-too_many_imfiles.

Vasu1105 commented 4 years ago

@Vasu1105 I can close this one and re-open from a personal fork https://github.com/runswithd6s/chef-rsyslog/tree/bug-119-too_many_imfiles.

Yes, I think you can do that.

runswithd6s commented 4 years ago

Closing. Re-opened as squashed commit in #161