Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disk queue looses message on rsyslog restart #5364

Open
d-shevtsov opened this issue Apr 14, 2024 · 2 comments
Open

Disk queue looses message on rsyslog restart #5364

d-shevtsov opened this issue Apr 14, 2024 · 2 comments

Comments

@d-shevtsov
Copy link

d-shevtsov commented Apr 14, 2024

Expected behavior

The disk queue with fsync of every message and checkpointInterval do not loose the message on the rsyslog restart.

Actual behavior

The disk queue looses the message on rsyslog restart.

Steps to reproduce the behavior

  1. Configure the omprog module that sends the message to the binary's stdin
if $msg contains 'session opened' then {
    action(type="omprog"
           binary="/path/to/binary"
           confirmMessages="on"
           confirmTimeout="2000"
           signalOnClose="off"
           closeTimeout="10000"
           killUnresponsive="on"
           forceSingleInstance="off"
           fileCreateMode="0600"
           output="/var/log/error.log"

           action.resumeRetryCount="-1"
           action.resumeInterval="2"

           queue.spoolDirectory="/var/log/rsyslog"
           queue.filename="rsyslog-queue"
           queue.size="10000"
           queue.type="Disk"
           queue.syncqueuefiles="on"
           queue.checkpointInterval="1"
           queue.workerThreads="1"
           queue.maxFileSize="64m"
           queue.timeoutshutdown="5000"
           queue.timeoutActionCompletion="2000"
           queue.saveOnShutdown="on")
}
  1. Write the binary that prints "OK" on startup then reads stdin (respecting EOF) and negative acknowledge all the messages with writing anything else than "OK" to stdout and error in stderr (to check logs in the following steps).

  2. Login as any user to the system, this should trigger the message action

  3. Observe in the rsyslog's logs that the message is retried (or configure impstats and check that the queue size became 1)

  4. Restart the rsyslog with systemctl restart rsyslog

  5. Observe that the message is no longer retried (impstats prints the queue size is 0, no rsyslog-queue disk queue is in the /var/log/rsyslog/ folder)

Environment

RHEL 9.3

	PLATFORM:				x86_64-redhat-linux-gnu
	PLATFORM (lsb_release -d):
	FEATURE_REGEXP:				Yes
	GSSAPI Kerberos 5 support:		Yes
	FEATURE_DEBUG (debug build, slow code):	No
	32bit Atomic operations supported:	Yes
	64bit Atomic operations supported:	Yes
	memory allocator:			system default
	Runtime Instrumentation (slow code):	No
	uuid support:				Yes
	systemd support:			Yes
	Config file:				/etc/rsyslog.conf
	PID file:				/var/run/rsyslogd.pid
	Number of Bits in RainerScript integers: 64

rsyslog configuration file at /etc/rsyslog.conf

global(workDirectory="/var/lib/rsyslog")
module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat")
module(load="imuxsock"
       SysSock.Use="off")
module(load="imjournal"
       UsePid="system"
       StateFile="imjournal.state")

include(file="/etc/rsyslog.d/*.conf" mode="optional")
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
authpriv.*                                              /var/log/secure
mail.*                                                  -/var/log/maillog
cron.*                                                  /var/log/cron
*.emerg                                                 :omusrmsg:*
uucp,news.crit                                          /var/log/spooler
local7.*                                                /var/log/boot.log
@davidelang
Copy link
Contributor

davidelang commented Apr 15, 2024 via email

@rgerhards
Copy link
Member

rgerhards commented Apr 15, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants