master
h 39 lines 1.6 KB
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2 //
3 // Process-wide configuration values resolved at netdata startup.
4 //
5 // libnetdata owns these globals. They start at compile-time defaults
6 // (from build/config.h) and are re-resolved against netdata_config by
7 // nd_runtime_paths_load_directories_from_inicfg() and
8 // nd_runtime_paths_load_hostname_from_inicfg(), which the daemon
9 // startup path invokes once after the config is loaded. Callers must
10 // not assign to these variables directly; use the loaders declared
11 // below.
12
13 #ifndef NETDATA_RUNTIME_PATHS_H
14 #define NETDATA_RUNTIME_PATHS_H
15
16 extern const char *netdata_configured_hostname;
17 extern const char *netdata_configured_user_config_dir;
18 extern const char *netdata_configured_stock_config_dir;
19 extern const char *netdata_configured_stock_data_dir;
20 extern const char *netdata_configured_log_dir;
21 extern const char *netdata_configured_primary_plugins_dir;
22 extern const char *netdata_configured_web_dir;
23 extern const char *netdata_configured_cache_dir;
24 extern const char *netdata_configured_varlib_dir;
25 extern const char *netdata_configured_cloud_dir;
26 extern const char *netdata_configured_home_dir;
27 extern const char *netdata_configured_host_prefix;
28
29 // Re-resolve the directory globals from the loaded netdata_config.
30 // Values absent from the config keep their compile-time defaults.
31 // Idempotent.
32 void nd_runtime_paths_load_directories_from_inicfg(void);
33
34 // Re-resolve host_prefix and hostname from netdata_config.
35 // host_prefix is loaded first because os_hostname uses it.
36 // Idempotent.
37 void nd_runtime_paths_load_hostname_from_inicfg(void);
38
39 #endif // NETDATA_RUNTIME_PATHS_H