/
githubmirror
/
rsyslog
Обзор
Документация
Войти
/
githubmirror
/
rsyslog
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/da-queue-persist.sh
48 строк
2 KB
Rainer Gerhards
tests: cover segmented disk-assisted queues
14 июл 2026, 21:57
14 июл 2026, 21:57
e4d59a0
Код
Авторство
О чём код?
#!/bin/bash # Test for classic DA queue data persisting at shutdown. This test deliberately # inspects the classic .qi file, so it pins diskQueueType="disk". A fast # shutdown must save the remaining messages and restart must drain them, with # duplicates allowed because the shutdown can interrupt an in-flight batch. # added 2019-05-08 by Rgerhards # This file is part of the rsyslog project, released under ASL 2.0 . ${srcdir:=.}/diag.sh init export NUMMESSAGES=10000 generate_conf add_conf ' global(workDirectory="'${RSYSLOG_DYNNAME}'.spool") main_queue(queue.type="linkedList" queue.filename="mainq" queue.timeoutShutdown="1" queue.saveonshutdown="on" queue.diskQueueType="disk") module(load="../plugins/omtesting/.libs/omtesting") template(name="outfmt" type="string" string="%msg:F,58:2%\n") if $msg contains "msgnum:" then action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt") else action(type="omfile" file="'$RSYSLOG_DYNNAME'.othermsg") $IncludeConfig '${RSYSLOG_DYNNAME}'work-delay.conf ' # prepare config echo "*.* :omtesting:sleep 0 1000" > ${RSYSLOG_DYNNAME}work-delay.conf startup injectmsg 0 $NUMMESSAGES shutdown_immediate wait_shutdown check_mainq_spool echo "Enter phase 2, rsyslogd restart" # note: we may have some few duplicates! echo "#" > ${RSYSLOG_DYNNAME}work-delay.conf wait_seq_check_with_dupes() { wait_seq_check 0 $((NUMMESSAGES - 1)) -d } export QUEUE_EMPTY_CHECK_FUNC=wait_seq_check_with_dupes startup shutdown_when_empty seq_check 0 $((NUMMESSAGES - 1)) -d content_check "queue files exist on disk, re-starting with" $RSYSLOG_DYNNAME.othermsg exit_test