Bug 1020431 - "last message repeated..." message missing if rsyslog is shut down during repetition
"last message repeated..." message missing if rsyslog is shut down during rep...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rsyslog7 (Show other bugs)
6.5
Unspecified Linux
low Severity low
: rc
: ---
Assigned To: Tomas Heinrich
Dalibor Pospíšil
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-17 12:09 EDT by Dalibor Pospíšil
Modified: 2014-10-14 03:30 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-10-14 03:30:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
fix for the issue (849 bytes, patch)
2014-06-04 11:24 EDT, Tomas Heinrich
no flags Details | Diff

  None (edit)
Description Dalibor Pospíšil 2013-10-17 12:09:39 EDT
Description of problem:
if $RepeatedMsgReduction is on the reduction message is logged to unexpected log.

Version-Release number of selected component (if applicable):
rsyslog-5.8.10-8.el6

How reproducible:
100%

Steps to Reproduce:
1. add to /etc/rsyslog.conf
$RepeatedMsgReduction on
$template mymsg,"%pri% - %pri-text%: %msg%\n"
local2.info /var/log/hostname-test.log;mymsg
*.* /var/log/hostname-test-all.log;mymsg

2. send three same messages using logger -p local2.info 'test'

Actual results:
# cat /var/log/hostname-test.log
150 - local2.info:  test

# cat /var/log/hostname-test-all.log
6 - kern.info: imklog 5.8.10, log source = /proc/kmsg started.
46 - syslog.info"  [origin software="rsyslogd" swVersion="5.8.10" x-pid="19602" x-info="http://www.rsyslog.com"] start
150 - local2.info:  test
150 - local2.info:  last message repeated 2 times
6 - kern.info: Kernel logging (proc) stopped.
46 - syslog.info:  [origin software="rsyslogd" swVersion="5.8.10" x-pid="19602" x-info="http://www.rsyslog.com"] exiting on signal 15.


Expected results:
# cat /var/log/hostname-test.log
150 - local2.info:  test
150 - local2.info:  last message repeated 2 times

Additional info:
this is ok on RHEL-7
Comment 3 Tomas Heinrich 2014-03-20 19:15:52 EDT
Reproduced.
This will be fixed either by the rebase to v7 (bug 869600) or an additional patch.
Comment 5 Tomas Heinrich 2014-06-04 11:22:46 EDT
After further investigation, the actual issue is that the "last message repeated..." status message is completely missing if rsyslog is shut down during this repetition. If a different message is logged, the status message is written as expected.

This bug is present in both v5 and v7, but v7 is very different in several aspects.
In v7, rate limiting and repetition are handled per-process. That means invoking logger multiple times won't trigger a repetition.

The attached patch attempts to fix the missing message and also plugs some memleaks.
Comment 6 Tomas Heinrich 2014-06-04 11:24:06 EDT
Created attachment 902216 [details]
fix for the issue
Comment 7 Tomas Heinrich 2014-06-04 11:28:47 EDT
(In reply to Dalibor Pospíšil from comment #0)
> Additional info:
> this is ok on RHEL-7

The reason for different perception of v7 is that in el7, by default, imjournal is used instead of imuxsock input plugin.
Comment 11 errata-xmlrpc 2014-10-14 03:30:38 EDT
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.

http://rhn.redhat.com/errata/RHEA-2014-1540.html

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