diff --git a/cookbooks/fb_syslog/README.md b/cookbooks/fb_syslog/README.md index e894a3e27..e282677c0 100644 --- a/cookbooks/fb_syslog/README.md +++ b/cookbooks/fb_syslog/README.md @@ -8,6 +8,7 @@ Requirements Attributes ---------- * node['fb_syslog']['manage_packages'] +* node['fb_syslog']['enable_imklog_permitnonkernelfacility'] * node['fb_syslog']['syslog-entries'] * node['fb_syslog']['rsyslog_server'] * node['fb_syslog']['rsyslog_server_address'] @@ -35,6 +36,17 @@ Usage This cookbook will install and manage the `rsyslog` package unless the `node['fb_syslog']['manage_packages]` attribute is set to `false`. +### enable_imklog_permitnonkernelfacility +The `enable_imklog_permitnonkernelfacility` option allows the `imklog` module +to capture logs from non-kernel facilities. By default, `imklog` only +processes logs from the kernel (kernel facility). However, user-space +applications can also write valuable system-level events, such as +reboot events, to the kernel(`/dev/kmsg`). When this option is enabled, +all logs sent to the kernel will be captured by `imklog` and recorded in +`/var/log/messages`. +`false` by default +https://www.rsyslog.com/doc/configuration/modules/imklog.html#permitnonkernelfacility + ### syslog-compatible entries The `node['fb_syslog']['syslog-entries']` is used to populate all lines in a `syslog.conf`, and all syslog-style entries in `rsyslog.conf`. @@ -245,4 +257,3 @@ node.default['fb_syslog']['sysconfig']['vars']['SYSLOGD_OPTIONS'] = But the `extra_lines` array is also available for forcing arbitrary stuff like `ulimit` calls. - diff --git a/cookbooks/fb_syslog/attributes/default.rb b/cookbooks/fb_syslog/attributes/default.rb index 864573652..a82982ba7 100644 --- a/cookbooks/fb_syslog/attributes/default.rb +++ b/cookbooks/fb_syslog/attributes/default.rb @@ -100,4 +100,5 @@ 'sysconfig' => sysconfig, '_enable_syslog_socket_override' => true, 'manage_packages' => true, + 'enable_imklog_permitnonkernelfacility' => false, } diff --git a/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog-kern.conf b/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog-kern.conf index a814e588d..dad820329 100644 --- a/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog-kern.conf +++ b/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog-kern.conf @@ -13,7 +13,7 @@ $PreserveFQDN on # Provides support for local system logging (e.g. via logger command) $ModLoad imuxsock # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +module(load="imklog") #### GLOBAL DIRECTIVES #### diff --git a/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf b/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf index 1afb7df6c..aba28edb0 100644 --- a/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf +++ b/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf @@ -13,7 +13,7 @@ $PreserveFQDN on # Provides support for local system logging (e.g. via logger command) $ModLoad imuxsock # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +module(load="imklog") #### GLOBAL DIRECTIVES #### diff --git a/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf_empty b/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf_empty index 6c2b2ce30..921a3afc1 100644 --- a/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf_empty +++ b/cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf_empty @@ -13,7 +13,7 @@ $PreserveFQDN on # Provides support for local system logging (e.g. via logger command) $ModLoad imuxsock # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +module(load="imklog") #### GLOBAL DIRECTIVES #### @@ -29,5 +29,3 @@ $FileGroup root $FileCreateMode 0644 $DirCreateMode 0755 $Umask 0002 - - diff --git a/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog-kern.conf b/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog-kern.conf index 409203636..6b553ee86 100644 --- a/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog-kern.conf +++ b/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog-kern.conf @@ -14,7 +14,7 @@ $PreserveFQDN on $ModLoad imuxsock $OmitLocalLogging off # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +module(load="imklog") #### GLOBAL DIRECTIVES #### diff --git a/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf b/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf index 7348f8d78..bb57dfe59 100644 --- a/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf +++ b/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf @@ -14,7 +14,7 @@ $PreserveFQDN on $ModLoad imuxsock $OmitLocalLogging off # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +module(load="imklog") #### GLOBAL DIRECTIVES #### diff --git a/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf_empty b/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf_empty index 5dd012040..236984a5f 100644 --- a/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf_empty +++ b/cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf_empty @@ -14,7 +14,7 @@ $PreserveFQDN on $ModLoad imuxsock $OmitLocalLogging off # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +module(load="imklog") #### GLOBAL DIRECTIVES #### @@ -30,5 +30,3 @@ $FileGroup root $FileCreateMode 0644 $DirCreateMode 0755 $Umask 0002 - - diff --git a/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog-kern.conf b/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog-kern.conf index 409203636..6b553ee86 100644 --- a/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog-kern.conf +++ b/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog-kern.conf @@ -14,7 +14,7 @@ $PreserveFQDN on $ModLoad imuxsock $OmitLocalLogging off # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +module(load="imklog") #### GLOBAL DIRECTIVES #### diff --git a/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog.conf b/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog.conf index 7348f8d78..bb57dfe59 100644 --- a/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog.conf +++ b/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog.conf @@ -14,7 +14,7 @@ $PreserveFQDN on $ModLoad imuxsock $OmitLocalLogging off # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +module(load="imklog") #### GLOBAL DIRECTIVES #### diff --git a/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog.conf_empty b/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog.conf_empty index 5dd012040..236984a5f 100644 --- a/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog.conf_empty +++ b/cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog.conf_empty @@ -14,7 +14,7 @@ $PreserveFQDN on $ModLoad imuxsock $OmitLocalLogging off # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +module(load="imklog") #### GLOBAL DIRECTIVES #### @@ -30,5 +30,3 @@ $FileGroup root $FileCreateMode 0644 $DirCreateMode 0755 $Umask 0002 - - diff --git a/cookbooks/fb_syslog/templates/default/rsyslog.conf.erb b/cookbooks/fb_syslog/templates/default/rsyslog.conf.erb index 2ee2a1cba..1c5d8b4ee 100644 --- a/cookbooks/fb_syslog/templates/default/rsyslog.conf.erb +++ b/cookbooks/fb_syslog/templates/default/rsyslog.conf.erb @@ -16,7 +16,11 @@ $ModLoad imuxsock $OmitLocalLogging off <% end -%> # Provides kernel logging support (previously done by rklogd) -$ModLoad imklog +<% if node['fb_syslog']['enable_imklog_permitnonkernelfacility'] -%> +module(load="imklog" permitnonkernelfacility="on") +<% else %> +module(load="imklog") +<% end -%> <% if node['fb_syslog']['rsyslog_use_omprog'] -%> # Provides logging to external programs. module(load="omprog")