diff options
author | Steven Hartland <steven.hartland@multiplay.co.uk> | 2019-10-17 14:35:08 +0100 |
---|---|---|
committer | Chris Akritidis <43294513+cakrit@users.noreply.github.com> | 2019-10-17 15:35:08 +0200 |
commit | 7ff016ea74261246def5500308f17cb575059856 (patch) | |
tree | fdb15a3a92ede70ffc41d74bddf4e64b740d7b30 /libnetdata/popen/popen.h | |
parent | 4b9cc50adc5d3cd0a644ebbd2d5db4ae66e4208e (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 'libnetdata/popen/popen.h')
-rw-r--r-- | libnetdata/popen/popen.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libnetdata/popen/popen.h b/libnetdata/popen/popen.h index 90d4b829b0..32f64e460b 100644 --- a/libnetdata/popen/popen.h +++ b/libnetdata/popen/popen.h @@ -11,6 +11,9 @@ extern FILE *mypopen(const char *command, volatile pid_t *pidptr); extern FILE *mypopene(const char *command, volatile pid_t *pidptr, char **env); extern int mypclose(FILE *fp, pid_t pid); +extern void myp_init(void); +extern void myp_free(void); +extern int myp_reap(pid_t pid); extern void signals_unblock(void); extern void signals_reset(void); |