From ad5200aa8cc1201a64e6dac58050af5aa1f40106 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Jul 27 2021 07:38:24 +0000 Subject: rsyslog.conf: first load default modules, then third-party config When we installed file /etc/rsyslog.d/03-ratelimits.conf: $IMJournalStateFile imjournal.state $IMJournalPersistStateInterval 1000 $IMJournalRatelimitInterval 1 $IMJournalRatelimitBurst 10000 rsyslog failed: invalid or yet-unknown config file command 'IMJournalStateFile' - have you forgotten to load a module? [v8.2010.0 try https://www.rsyslog.com/e/3003 ] invalid or yet-unknown config file command 'IMJournalPersistStateInterval' - have you forgotten to load a module? [v8.2010.0 try https://www.rsyslog.com/e/3003 ] invalid or yet-unknown config file command 'IMJournalRatelimitInterval' - have you forgotten to load a module? [v8.2010.0 try https://www.rsyslog.com/e/3003 ] invalid or yet-unknown config file command 'IMJournalRatelimitBurst' - have you forgotten to load a module? [v8.2010.0 try https://www.rsyslog.com/e/3003 ] That's because imjournal was loaded later than that config file. If module was explicitly loaded via '$ModLoad imjournal' in our third-party file, we got a different error: module 'imjournal' already in this config, cannot be added [v8.2010.0 try https://www.rsyslog.com/e/2221 ] When the config file is reordered like this, no errors are shown. Resolves: rhbz#1985202 --- diff --git a/rsyslog.conf b/rsyslog.conf index b51e844..f6d3f6a 100644 --- a/rsyslog.conf +++ b/rsyslog.conf @@ -9,19 +9,20 @@ # Where to place auxiliary files global(workDirectory="/var/lib/rsyslog") +#### MODULES #### + # Use default timestamp format module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat") +module(load="imuxsock" # provides support for local system logging (e.g. via logger command) + SysSock.Use="off") # Turn off message reception via local log socket; + # local messages are retrieved through imjournal now. +module(load="imjournal" # provides access to the systemd journal + StateFile="imjournal.state") # File to store the position in the journal + # Include all config files in /etc/rsyslog.d/ include(file="/etc/rsyslog.d/*.conf" mode="optional") -#### MODULES #### - -module(load="imuxsock" # provides support for local system logging (e.g. via logger command) - SysSock.Use="off") # Turn off message reception via local log socket; - # local messages are retrieved through imjournal now. -module(load="imjournal" # provides access to the systemd journal - StateFile="imjournal.state") # File to store the position in the journal #module(load="imklog") # reads kernel messages (the same are read from journald) #module(load="immark") # provides --MARK-- message capability diff --git a/rsyslog.spec b/rsyslog.spec index 7791bf7..ba6eb36 100644 --- a/rsyslog.spec +++ b/rsyslog.spec @@ -8,7 +8,7 @@ Summary: Enhanced system logging and kernel message trapping daemon Name: rsyslog Version: 8.2102.0 -Release: 3%{?dist} +Release: 4%{?dist} License: (GPLv3+ and ASL 2.0) URL: http://www.rsyslog.com/ Source0: http://www.rsyslog.com/files/download/rsyslog/%{name}-%{version}.tar.gz @@ -550,6 +550,9 @@ done %changelog +* Tue Jul 27 2021 Pavel Raiskup - 8.2102.0-4 +- reorder the rsyslog.conf to simplify the rsyslog.d configuration (#1985202) + * Fri Jul 23 2021 Fedora Release Engineering - 8.2102.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild