summaryrefslogtreecommitdiffstats
path: root/collectors/tc.plugin
diff options
context:
space:
mode:
authorSteven Hartland <steven.hartland@multiplay.co.uk>2019-10-17 14:35:08 +0100
committerChris Akritidis <43294513+cakrit@users.noreply.github.com>2019-10-17 15:35:08 +0200
commit7ff016ea74261246def5500308f17cb575059856 (patch)
treefdb15a3a92ede70ffc41d74bddf4e64b740d7b30 /collectors/tc.plugin
parent4b9cc50adc5d3cd0a644ebbd2d5db4ae66e4208e (diff)
feat(reaper): Add process reaper support (#7059)
##### Summary Add a child process reaper to the main netdata app if running as init (pid = 1). This prevents zombie processes when a child is re-parented to netdata when its running in a container. Also: * Few style cleanups to match surrounding code. Fixes: #6033 ##### Component Name netdata binary ##### Additional Information This re-purposes old commented out code in `popen.c`, which already implemented part of the required process tracking. Without this on a standard netdata docker install we saw at least one zombie `timeout` process straight after the container was started.
Diffstat (limited to 'collectors/tc.plugin')
-rw-r--r--collectors/tc.plugin/plugin_tc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/collectors/tc.plugin/plugin_tc.c b/collectors/tc.plugin/plugin_tc.c
index 50383f4ce3..9245b0857f 100644
--- a/collectors/tc.plugin/plugin_tc.c
+++ b/collectors/tc.plugin/plugin_tc.c
@@ -851,12 +851,11 @@ static void tc_main_cleanup(void *ptr) {
if(tc_child_pid) {
info("TC: killing with SIGTERM tc-qos-helper process %d", tc_child_pid);
- if(killpid(tc_child_pid, SIGTERM) != -1) {
+ if(killpid(tc_child_pid) != -1) {
siginfo_t info;
info("TC: waiting for tc plugin child process pid %d to exit...", tc_child_pid);
waitid(P_PID, (id_t) tc_child_pid, &info, WEXITED);
- // info("TC: finished tc plugin child process pid %d.", tc_child_pid);
}
tc_child_pid = 0;