mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-18 06:20:42 +01:00
Restart the program if it does not respond within timeout. New setting 'confirmTimeout' (default 10 seconds). Allow the program to provide keep-alive feedback when a message requires long-running processing. Improve efficiency when reading feedback line (use buffer). Retry interrupted writes/reads to/from pipe. New setting 'reportFailures' for reporting error messages from the program. Report child termination when writing to pipe. Minor refactor: renamed writePipe function to sendMessage, renamed readPipe to readStatus.
34 lines
589 B
Bash
Executable File
34 lines
589 B
Bash
Executable File
#!/bin/bash
|
|
|
|
outfile=$RSYSLOG_OUT_LOG
|
|
|
|
status="OK"
|
|
echo "<= $status" >> $outfile
|
|
echo "$status"
|
|
|
|
retry_count=0
|
|
|
|
read line
|
|
while [[ -n "$line" ]]; do
|
|
message=${line//$'\n'}
|
|
echo "=> $message" >> $outfile
|
|
|
|
if [[ $message == *04* || $message == *07* ]]; then
|
|
if [[ $retry_count < 2 ]]; then
|
|
status="Error: could not process log message"
|
|
let "retry_count++"
|
|
else
|
|
status="OK"
|
|
retry_count=0
|
|
fi
|
|
else
|
|
status="OK"
|
|
fi
|
|
|
|
echo "<= $status" >> $outfile
|
|
echo "$status"
|
|
read line
|
|
done
|
|
|
|
exit 0
|