summaryrefslogtreecommitdiffstats
path: root/collectors/debugfs.plugin/debugfs_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--collectors/debugfs.plugin/debugfs_plugin.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/collectors/debugfs.plugin/debugfs_plugin.c b/collectors/debugfs.plugin/debugfs_plugin.c
index 105b0a9e4..13012ec40 100644
--- a/collectors/debugfs.plugin/debugfs_plugin.c
+++ b/collectors/debugfs.plugin/debugfs_plugin.c
@@ -159,19 +159,11 @@ static void debugfs_parse_args(int argc, char **argv)
int main(int argc, char **argv)
{
- // debug_flags = D_PROCFILE;
- stderror = stderr;
-
- // set the name for logging
- program_name = "debugfs.plugin";
-
- // disable syslog for debugfs.plugin
- error_log_syslog = 0;
-
- log_set_global_severity_for_external_plugins();
+ clocks_init();
+ nd_log_initialize_for_external_plugins("debugfs.plugin");
netdata_configured_host_prefix = getenv("NETDATA_HOST_PREFIX");
- if (verify_netdata_host_prefix() == -1)
+ if (verify_netdata_host_prefix(true) == -1)
exit(1);
user_config_dir = getenv("NETDATA_USER_CONFIG_DIR");
@@ -243,6 +235,13 @@ int main(int argc, char **argv)
netdata_log_info("all modules are disabled, exiting...");
return 1;
}
+
+ fprintf(stdout, "\n");
+ fflush(stdout);
+ if (ferror(stdout) && errno == EPIPE) {
+ netdata_log_error("error writing to stdout: EPIPE. Exiting...");
+ return 1;
+ }
}
fprintf(stdout, "EXIT\n");