diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
commit | dcc721a95bef6f0d8e6d8775b8efe33e5aecd562 (patch) | |
tree | 66a2774cd0ee294d019efd71d2544c70f42b2842 /tests/testsuites/omprog-close-unresponsive-bin.sh | |
parent | Initial commit. (diff) | |
download | rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.tar.xz rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.zip |
Adding upstream version 8.2402.0.upstream/8.2402.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/testsuites/omprog-close-unresponsive-bin.sh')
-rwxr-xr-x | tests/testsuites/omprog-close-unresponsive-bin.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/testsuites/omprog-close-unresponsive-bin.sh b/tests/testsuites/omprog-close-unresponsive-bin.sh new file mode 100755 index 0000000..9f36644 --- /dev/null +++ b/tests/testsuites/omprog-close-unresponsive-bin.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +outfile=$RSYSLOG_OUT_LOG + +function handle_sigterm { + echo "Received SIGTERM" >> $outfile +} +trap "handle_sigterm" SIGTERM + +echo "Starting" >> $outfile + +# Tell rsyslog we are ready to start processing messages +echo "OK" + +read log_line +while [[ -n "$log_line" ]]; do + echo "Received $log_line" >> $outfile + + # Tell rsyslog we are ready to process the next message + echo "OK" + + read log_line +done + +echo "Terminating unresponsively" >> $outfile + +# Terminate with a very long sleep, so omprog will kill this process when +# the closeTimeout (which we have configured to a short value) is reached. +# (Note hat the sleep subprocess itself will not be killed.) +sleep 150s + +exit 0 |