diff --git a/tools/scripts/rsyslog-4xx-recovery b/tools/scripts/rsyslog-4xx-recovery index b2ac2946f78d..efa43b0e7760 100755 --- a/tools/scripts/rsyslog-4xx-recovery +++ b/tools/scripts/rsyslog-4xx-recovery @@ -12,7 +12,7 @@ def write_stdout(s): sys.stdout.flush() def write_stderr(s): - sys.stderr.write(s) + sys.stderr.write(f"[rsyslog-4xx-recovery] {s}") sys.stderr.flush() def main(): @@ -47,6 +47,15 @@ def main(): except Exception as e: write_stderr(str(e)) + if "action-0-omhttp queue: need to do hard cancellation" in log_message: + try: + write_stderr( + f"{datetime.datetime.now(timezone.utc)} - sending SIGKILL to proc=[{proc_details['processname']}] with pid=[{int(proc_details['pid'])}] due to log_message=[{log_message}]\n" + ) + os.kill(int(proc_details["pid"]), signal.SIGKILL) + except Exception as e: + write_stderr(str(e)) + write_stdout("RESULT 2\nOK")