#else
{"proc", "plugins", "proc", 1, NULL, NULL, proc_main},
{"diskspace", "plugins", "diskspace", 1, NULL, NULL, proc_diskspace_main},
-#endif /* __FreeBSD__, __APPLE__*/
{"cgroups", "plugins", "cgroups", 1, NULL, NULL, cgroups_main},
+#endif /* __FreeBSD__, __APPLE__*/
{"check", "plugins", "checks", 0, NULL, NULL, checks_main},
{"backends", NULL, NULL, 1, NULL, NULL, backends_main},
{"health", NULL, NULL, 1, NULL, NULL, health_main},
pthread_cancel(w->thread);
// it is detached
// pthread_join(w->thread, NULL);
+
+ w->obsolete = 1;
}
int i;
for (i = 0; static_threads[i].name != NULL ; i++) {
- if(static_threads[i].enabled && static_threads[i].thread) {
+ if(static_threads[i].enabled) {
info("Stopping %s thread", static_threads[i].name);
pthread_cancel(*static_threads[i].thread);
// it is detached
// pthread_join(*static_threads[i].thread, NULL);
- static_threads[i].thread = NULL;
+ static_threads[i].enabled = 0;
}
}
info("Killing tc-qos-helper process %d", tc_child_pid);
if(killpid(tc_child_pid, SIGTERM) != -1)
waitid(P_PID, (id_t) tc_child_pid, &info, WEXITED);
+
+ tc_child_pid = 0;
}
- tc_child_pid = 0;
struct plugind *cd;
for(cd = pluginsd_root ; cd ; cd = cd->next) {
if(cd->enabled && !cd->obsolete) {
- if(cd->thread != (pthread_t)NULL) {
- info("Stopping %s plugin thread", cd->id);
- pthread_cancel(cd->thread);
- // they are detached
- // pthread_join(cd->thread, NULL);
- cd->thread = (pthread_t)NULL;
- }
+ info("Stopping %s plugin thread", cd->id);
+ pthread_cancel(cd->thread);
if(cd->pid) {
info("killing %s plugin child process pid %d", cd->id, cd->pid);
if(max_len_arg > 30) max_len_arg = 30;
if(max_len_arg < 20) max_len_arg = 20;
- fprintf(stream, "\n"
+ fprintf(stream, "%s", "\n"
" ^\n"
" |.-. .-. .-. .-. . netdata \n"
" | '-' '-' '-' '-' real-time performance monitoring, done right! \n"
" +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->\n"
"\n"
- " Copyright (C) 2017, Costa Tsaousis <costa@tsaousis.gr>\n"
+ " Copyright (C) 2016-2017, Costa Tsaousis <costa@tsaousis.gr>\n"
" Released under GNU Public License v3 or later.\n"
" All rights reserved.\n"
"\n"
if(!p) p = "/bin:/usr/bin";
snprintfz(path, 1024, "%s:%s", p, "/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
setenv("PATH", config_get("plugins", "PATH environment variable", path), 1);
+
+ p = getenv("PYTHONPATH");
+ if(!p) p = "";
+ setenv("PYTHONPATH", config_get("plugins", "PYTHONPATH environment variable", p), 1);
}
char *user = NULL;
if(setrlimit(RLIMIT_CORE, &rl) != 0)
error("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
-#if !(defined(__FreeBSD__) || defined(__APPLE__))
+#ifdef HAVE_SYS_PRCTL_H
prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
-#endif /* __FreeBSD__ || __APPLE__*/
+#endif
}
// --------------------------------------------------------------------
struct rlimit rl = { RLIM_INFINITY, RLIM_INFINITY };
if(setrlimit(RLIMIT_CORE, &rl) != 0)
error("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
-#if !(defined(__FreeBSD__) || defined(__APPLE__))
+#ifdef HAVE_SYS_PRCTL_H
prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
-#endif /* __FreeBSD__ || __APPLE__*/
+#endif
}
#endif /* NETDATA_INTERNAL_CHECKS */