summaryrefslogtreecommitdiffstats
path: root/libnetdata/popen
diff options
context:
space:
mode:
authorSteve8291 <hambling8@gmail.com>2021-04-15 11:13:50 -0400
committerGitHub <noreply@github.com>2021-04-15 18:13:50 +0300
commit307dc627d882d8b10a05862e073eb6feb2f6d7ec (patch)
tree14364d3201253bc2fcc5c26599c06c573ccf4ed6 /libnetdata/popen
parent18a5cb9e7c33fb8c4f2bb14696c1b9dc532ea5d6 (diff)
Remove error message on netdata restart (#8685)
When issuing a SIGTERM with `systemctl restart netdata.service` an ERROR message is created in the log for every plugin: > netdata ERROR : PLUGINSD[apps] : child pid 23901 killed by signal 15. > netdata ERROR : PLUGINSD[python.d] : child pid 23908 killed by signal 15. > netdata ERROR : PLUGINSD[nfacct] : child pid 23909 killed by signal 15. > netdata ERROR : PLUGINSD[go.d] : child pid 23899 killed by signal 15. Seems like it would be worth silencing this to an INFO message if we did a proper restart or shutdown. Also, I wasn't sure what the proper return code should be so I put it in as `return(0);`
Diffstat (limited to 'libnetdata/popen')
-rw-r--r--libnetdata/popen/popen.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libnetdata/popen/popen.c b/libnetdata/popen/popen.c
index c0135cf406..33f4bd950c 100644
--- a/libnetdata/popen/popen.c
+++ b/libnetdata/popen/popen.c
@@ -296,8 +296,14 @@ int custom_pclose(FILE *fp, pid_t pid) {
return(info.si_status);
case CLD_KILLED:
- error("child pid %d killed by signal %d.", info.si_pid, info.si_status);
- return(-1);
+ if(info.si_status == 15) {
+ info("child pid %d killed by signal %d.", info.si_pid, info.si_status);
+ return(0);
+ }
+ else {
+ error("child pid %d killed by signal %d.", info.si_pid, info.si_status);
+ return(-1);
+ }
case CLD_DUMPED:
error("child pid %d core dumped by signal %d.", info.si_pid, info.si_status);