Browse Source

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);`
Steve8291 3 years ago
parent
commit
307dc627d8
1 changed files with 8 additions and 2 deletions
  1. 8 2
      libnetdata/popen/popen.c

+ 8 - 2
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);