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 committed
Apr 15, 2021 at 11:13 UTC
307dc627d882d8b10a05862e073eb6feb2f6d7ec
1 file changed
+8
-2
libnetdata/popen/popen.c
+8
-2
@@ -296,8 +296,14 @@ int custom_pclose(FILE *fp, pid_t pid) {
296
return(info.si_status);
297
298
case CLD_KILLED:
299
- error("child pid %d killed by signal %d.", info.si_pid, info.si_status);
300
- return(-1);
299
+ if(info.si_status == 15) {
300
+ info("child pid %d killed by signal %d.", info.si_pid, info.si_status);
301
+ return(0);
302
+ }
303
+ else {
304
+ error("child pid %d killed by signal %d.", info.si_pid, info.si_status);
305
+ return(-1);
306
+ }
307
308
case CLD_DUMPED:
309
error("child pid %d core dumped by signal %d.", info.si_pid, info.si_status);