rsyslog/tests/imfile-persist-state-1.sh
Andre Lorbach 7508010750 Basic Imfile FEN API support for Solaris (#2141)
imfile: Initial implementation of solaris FEN API (without wildcards)

FEN API is used to implement simular event based file
monitoring like with inotify.

This commit provides partial functionality. It supports event-driven
processing of files but does not yet provide wildcard functionality.
Wildscards will be provided by a later commit.

This can be committed as-is because the previous code did also
not provide wildcard support, so this is an improvement for
Solaris in any case.

see also https://github.com/rsyslog/rsyslog/issues/1954
2017-12-01 12:49:38 +01:00

32 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# added 2016-11-02 by rgerhards
# This is part of the rsyslog testbench, licensed under ASL 2.0
echo [imfile-persist-state-1.sh]
. $srcdir/diag.sh check-inotify
. $srcdir/diag.sh init
. $srcdir/diag.sh generate-conf
. $srcdir/diag.sh add-conf '
global(workDirectory="test-spool")
module(load="../plugins/imfile/.libs/imfile")
input( type="imfile"
file="./rsyslog.input"
tag="file:"
startmsg.regex="^msgnum"
PersistStateInterval="1"
)
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")
'
# generate input file first. Note that rsyslog processes it as
# soon as it start up (so the file should exist at that point).
./inputfilegen 5 4000 > rsyslog.input
. $srcdir/diag.sh startup
. $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
. $srcdir/diag.sh wait-shutdown # we need to wait until rsyslogd is finished!
. $srcdir/diag.sh seq-check 0 3
. $srcdir/diag.sh exit