Branch: refs/heads/1.6.0
Home:
https://github.com/tribe29/checkmk
Commit: fecdb0f2ee03074d34e1bf459bc586165529ac00
https://github.com/tribe29/checkmk/commit/fecdb0f2ee03074d34e1bf459bc586165…
Author: Benedikt Seidl <benedikt.seidl(a)tribe29.com>
Date: 2021-07-26 (Mon, 26 Jul 2021)
Changed paths:
A .werks/13026
M agents/plugins/mk_db2.linux
Log Message:
-----------
13026 FIX agent plugin mk_db2.linux: fix timeout
When the db2 queries take longer than 10 seconds, the command is
terminated.
Before this fix the termination did not work out as expected: Only the
currently running command was terminated, but the script was still
running in the background. This lead to a very confusing output: The
output of the terminated script was interleaved with the output of the
remaining script. The sections where mixed up and various other db2
checks crashed with strange error messages.
The whole problem can be simulated with the following script ran as
root:
#!/bin/bash
function testing {
for i in {0..6}
do
echo $i; sleep 1
done
}
export -f testing
#timeout -s 9 2 su cmkd -s /bin/bash -c "testing"
timeout 2 su cmkd -s /bin/bash -c "testing"
When running the `-s 9` version, you can see numbers after the timeout
occurred, the other version is correctly stopped, as `su` propagates
SIGTERM to it's child.
Change-Id: I32a1b763f776728e603d2e9fb94bb36e8167e071