summaryrefslogtreecommitdiffstats
path: root/tests/testsuites/omprog-close-unresponsive-bin.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testsuites/omprog-close-unresponsive-bin.sh')
-rwxr-xr-xtests/testsuites/omprog-close-unresponsive-bin.sh32
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