RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1143846 - Rsyslog logging seems inverted during use of SysSock.Use directive.
Summary: Rsyslog logging seems inverted during use of SysSock.Use directive.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rsyslog
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Tomas Heinrich
QA Contact: Marek Marusic
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-18 06:52 UTC by Marek Marusic
Modified: 2020-09-20 13:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 14:29:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2173 0 normal SHIPPED_LIVE rsyslog bug fix update 2015-11-19 11:34:00 UTC

Description Marek Marusic 2014-09-18 06:52:41 UTC
Description of problem:

Rsyslog failure, behaviour of logging seems inverted while using SysSock.Use on or off

Version-Release number of selected component (if applicable):
rsyslog-7.4.7-6.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1.Set SysSock.Use="on" or SysSock.Use="off" in rsyslgo.conf

Actual results:

With 
module(load="imuxsock" SysSock.Use="on")

I get:
Sep 18 02:39:12 localhost systemd[1]: Started System Logging Service.
Sep 18 02:39:12 localhost systemd: Started System Logging Service.
Sep 18 02:39:12 localhost root: TEST MESSAGE1
Sep 18 02:39:12 localhost root: TEST MESSAGE1

With 
module(load="imuxsock" SysSock.Use="off")

I get:
Sep 18 02:40:59 localhost systemd: Started System Logging Service.
Sep 18 02:40:59 localhost root: TEST MESSAGE1


While using old syntax directives
$ModLoad imuxsock
$OmitLocalLogging on

I get:
Sep 18 02:43:59 localhost systemd: Started System Logging Service.
Sep 18 02:44:00 localhost root: TEST MESSAGE1

and with
$ModLoad imuxsock
$OmitLocalLogging off

I get:
Sep 18 02:45:22 localhost systemd: Started System Logging Service.
Sep 18 02:45:22 localhost systemd[1]: Started System Logging Service.
Sep 18 02:45:22 localhost root: TEST MESSAGE1
Sep 18 02:45:22 localhost root: TEST MESSAGE1

Expected results:
Logging is the same for the old and the new syntax

Comment 2 Tomas Heinrich 2014-09-18 12:03:59 UTC
(In reply to Marek Marusic from comment #0)
> With 
> module(load="imuxsock" SysSock.Use="on")

This is not enough information. Without seeing your whole configuration, this is just guesswork.

> I get:
> Sep 18 02:39:12 localhost systemd[1]: Started System Logging Service.
> Sep 18 02:39:12 localhost systemd: Started System Logging Service.
> Sep 18 02:39:12 localhost root: TEST MESSAGE1
> Sep 18 02:39:12 localhost root: TEST MESSAGE1
> 
> With 
> module(load="imuxsock" SysSock.Use="off")
> 
> I get:
> Sep 18 02:40:59 localhost systemd: Started System Logging Service.
> Sep 18 02:40:59 localhost root: TEST MESSAGE1

The duplication occurs because (I assume) you don't turn off the imjournal plugin.

> While using old syntax directives
> $ModLoad imuxsock
> $OmitLocalLogging on

> Expected results:
> Logging is the same for the old and the new syntax

Maybe I'm misinterpreting your request, but please note there is a difference between

SysSock.Use (as in "use")

and

$OmitLocalLogging (as in "don't use")

If my interpretation is correct, this should be closed as not-a-bug.

Comment 3 Marek Marusic 2014-09-18 12:54:11 UTC
> This is not enough information. Without seeing your whole configuration, this is just guesswork.

Below is configuration file used in this case and also it is default config for RHEL7.

# rsyslog configuration file

# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html

#### MODULES ####

# The imjournal module bellow is now used as a message source instead of imuxsock.
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imjournal # provides access to the systemd journal
#$ModLoad imklog # reads kernel messages (the same are read from journald)
#$ModLoad immark  # provides --MARK-- message capability

# Provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514

# Provides TCP syslog reception
#$ModLoad imtcp
#$InputTCPServerRun 514


#### GLOBAL DIRECTIVES ####

# Where to place auxiliary files
$WorkDirectory /var/lib/rsyslog

# Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

# File syncing capability is disabled by default. This feature is usually not required,
# not useful and an extreme performance hit
#$ActionFileEnableSync on

# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/*.conf

# Turn off message reception via local log socket;
# local messages are retrieved through imjournal now.
$OmitLocalLogging on

# File to store the position in the journal
$IMJournalStateFile imjournal.state


#### RULES ####

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog


# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 :omusrmsg:*

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log



and this one should be the same but using new syntax:


module(load="imuxsock" SysSock.Use="on" SysSock.Name="/run/systemd/journal/syslog")

module(load="imjournal" StateFile="imjournal.state")

global(workDirectory="/var/lib/rsyslog")

module(load="builtin:omfile" template="RSYSLOG_TraditionalFileFormat")

$IncludeConfig /etc/rsyslog.d/*.conf

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 action(type="omfile" file="/dev/console")

# Log anything (except mail) of level info or higher.
# Don\t log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                action(type="omfile" file="/var/log/messages")

# The authpriv file has restricted access.
authpriv.*                                              action(type="omfile" file="/var/log/secure")

# Log all the mail messages in one place.
mail.*                                                  action(type="omfile" file="/var/log/maillog")


# Log cron stuff
cron.*                                                  action(type="omfile" file="/var/log/cron")

# Everybody gets emergency messages
*.emerg                                                 action(type="omusrmsg" users="*")

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          action(type="omfile" file="/var/log/spooler")

# Save boot messages also to boot.log

local7.*                                                action(type="omfile" file="/var/log/boot.log")


> The duplication occurs because (I assume) you don't turn off the imjournal plugin.

The imjournal plugin is enabled by default so I didn't turn it off in neither test.

> Maybe I'm misinterpreting your request, but please note there is a difference between

> SysSock.Use (as in "use")

> and

> $OmitLocalLogging (as in "don't use")
This is written in rsyslog doc

SysSock.Use (imuxsock) [on/off] do NOT listen for the local log socket. This is most useful if you run multiple instances of rsyslogd where only one shall handle the system log socket.[1]

$OmitLocalLogging (imuxsock) [on/off] – former -o option; do NOT listen for the local log socket. This is most useful if you run multiple instances of rsyslogd where only one shall handle the system log socket.[2]

Both are by default set to off, if I understand it right, SysSock.Use="on" should equal OmitLocalLogging on. But litteraly it shoul be the way you say, so may be there is mistake in documentation.

[1] http://www.rsyslog.com/doc/v7-stable/configuration/modules/imuxsock.html
[2] http://www.rsyslog.com/doc/v5-stable/configuration/modules/imuxsock.html

Comment 4 Tomas Heinrich 2014-09-19 09:08:20 UTC
(In reply to Marek Marusic from comment #3)
> Both are by default set to off, if I understand it right, SysSock.Use="on"
> should equal OmitLocalLogging on. But litteraly it shoul be the way you say,
> so may be there is mistake in documentation.
> 
> [1] http://www.rsyslog.com/doc/v7-stable/configuration/modules/imuxsock.html
> [2] http://www.rsyslog.com/doc/v5-stable/configuration/modules/imuxsock.html

The documentation is wrong (even [3]); looks like a C&P error.
Actually, new one is the inverse of the old one.

[3] http://www.rsyslog.com/doc/master/configuration/modules/imuxsock.html

Comment 5 Karel Srot 2014-09-19 09:50:50 UTC
Hi Tomas,
could you please get in touch with the upstream and try to fix the documentation? This is quite visible topic and we are afraid that if the difference won't be visible in docs it might cause a lot of confusion among users.

Comment 6 Tomas Heinrich 2014-10-23 14:14:19 UTC
I've sent the change upstream.

Comment 10 errata-xmlrpc 2015-11-19 14:29:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2173.html


Note You need to log in before you can comment on or make changes to this bug.