summaryrefslogtreecommitdiffstats
path: root/collectors/debugfs.plugin/debugfs_plugin.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:22 +0000
commitc21c3b0befeb46a51b6bf3758ffa30813bea0ff0 (patch)
tree9754ff1ca740f6346cf8483ec915d4054bc5da2d /collectors/debugfs.plugin/debugfs_plugin.c
parentAdding upstream version 1.43.2. (diff)
downloadnetdata-upstream/1.44.3.tar.xz
netdata-upstream/1.44.3.zip
Adding upstream version 1.44.3.upstream/1.44.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/debugfs.plugin/debugfs_plugin.c')
-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");