Skip to content

Commit a622294

Browse files
Antony Thomasfacebook-github-bot
authored andcommitted
Enable kernel logging to include all facilities in /var/log/messages
Differential Revision: D66282632 fbshipit-source-id: adb4f262b7a9b2b1a60d1e3158f54c04dbd670d1
1 parent f303a6b commit a622294

File tree

12 files changed

+27
-17
lines changed

12 files changed

+27
-17
lines changed

cookbooks/fb_syslog/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Requirements
88
Attributes
99
----------
1010
* node['fb_syslog']['manage_packages']
11+
* node['fb_syslog']['enable_imklog_permitnonkernelfacility']
1112
* node['fb_syslog']['syslog-entries']
1213
* node['fb_syslog']['rsyslog_server']
1314
* node['fb_syslog']['rsyslog_server_address']
@@ -35,6 +36,17 @@ Usage
3536
This cookbook will install and manage the `rsyslog` package unless the
3637
`node['fb_syslog']['manage_packages]` attribute is set to `false`.
3738

39+
### enable_imklog_permitnonkernelfacility
40+
The `enable_imklog_permitnonkernelfacility` option allows the `imklog` module
41+
to capture logs from non-kernel facilities. By default, `imklog` only
42+
processes logs from the kernel (kernel facility). However, user-space
43+
applications can also write valuable system-level events, such as
44+
reboot events, to the kernel(`/dev/kmsg`). When this option is enabled,
45+
all logs sent to the kernel will be captured by `imklog` and recorded in
46+
`/var/log/messages`.
47+
`false` by default
48+
https://www.rsyslog.com/doc/configuration/modules/imklog.html#permitnonkernelfacility
49+
3850
### syslog-compatible entries
3951
The `node['fb_syslog']['syslog-entries']` is used to populate all lines
4052
in a `syslog.conf`, and all syslog-style entries in `rsyslog.conf`.
@@ -245,4 +257,3 @@ node.default['fb_syslog']['sysconfig']['vars']['SYSLOGD_OPTIONS'] =
245257

246258
But the `extra_lines` array is also available for forcing arbitrary stuff like
247259
`ulimit` calls.
248-

cookbooks/fb_syslog/attributes/default.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,5 @@
100100
'sysconfig' => sysconfig,
101101
'_enable_syslog_socket_override' => true,
102102
'manage_packages' => true,
103+
'enable_imklog_permitnonkernelfacility' => false,
103104
}

cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog-kern.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $PreserveFQDN on
1313
# Provides support for local system logging (e.g. via logger command)
1414
$ModLoad imuxsock
1515
# Provides kernel logging support (previously done by rklogd)
16-
$ModLoad imklog
16+
module(load="imklog")
1717

1818
#### GLOBAL DIRECTIVES ####
1919

cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $PreserveFQDN on
1313
# Provides support for local system logging (e.g. via logger command)
1414
$ModLoad imuxsock
1515
# Provides kernel logging support (previously done by rklogd)
16-
$ModLoad imklog
16+
module(load="imklog")
1717

1818
#### GLOBAL DIRECTIVES ####
1919

cookbooks/fb_syslog/spec/fixtures/centos6/rsyslog.conf_empty

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $PreserveFQDN on
1313
# Provides support for local system logging (e.g. via logger command)
1414
$ModLoad imuxsock
1515
# Provides kernel logging support (previously done by rklogd)
16-
$ModLoad imklog
16+
module(load="imklog")
1717

1818
#### GLOBAL DIRECTIVES ####
1919

@@ -29,5 +29,3 @@ $FileGroup root
2929
$FileCreateMode 0644
3030
$DirCreateMode 0755
3131
$Umask 0002
32-
33-

cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog-kern.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $PreserveFQDN on
1414
$ModLoad imuxsock
1515
$OmitLocalLogging off
1616
# Provides kernel logging support (previously done by rklogd)
17-
$ModLoad imklog
17+
module(load="imklog")
1818

1919
#### GLOBAL DIRECTIVES ####
2020

cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $PreserveFQDN on
1414
$ModLoad imuxsock
1515
$OmitLocalLogging off
1616
# Provides kernel logging support (previously done by rklogd)
17-
$ModLoad imklog
17+
module(load="imklog")
1818

1919
#### GLOBAL DIRECTIVES ####
2020

cookbooks/fb_syslog/spec/fixtures/centos7/rsyslog.conf_empty

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $PreserveFQDN on
1414
$ModLoad imuxsock
1515
$OmitLocalLogging off
1616
# Provides kernel logging support (previously done by rklogd)
17-
$ModLoad imklog
17+
module(load="imklog")
1818

1919
#### GLOBAL DIRECTIVES ####
2020

@@ -30,5 +30,3 @@ $FileGroup root
3030
$FileCreateMode 0644
3131
$DirCreateMode 0755
3232
$Umask 0002
33-
34-

cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog-kern.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $PreserveFQDN on
1414
$ModLoad imuxsock
1515
$OmitLocalLogging off
1616
# Provides kernel logging support (previously done by rklogd)
17-
$ModLoad imklog
17+
module(load="imklog")
1818

1919
#### GLOBAL DIRECTIVES ####
2020

cookbooks/fb_syslog/spec/fixtures/centos8/rsyslog.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $PreserveFQDN on
1414
$ModLoad imuxsock
1515
$OmitLocalLogging off
1616
# Provides kernel logging support (previously done by rklogd)
17-
$ModLoad imklog
17+
module(load="imklog")
1818

1919
#### GLOBAL DIRECTIVES ####
2020

0 commit comments

Comments
 (0)