diff options
Diffstat (limited to 'daemon/main.c')
-rw-r--r-- | daemon/main.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/daemon/main.c b/daemon/main.c index 6ddf57aa1..ab7997969 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -761,7 +761,7 @@ int help(int exitcode) { " Support : https://github.com/netdata/netdata/issues\n" " License : https://github.com/netdata/netdata/blob/master/LICENSE.md\n" "\n" - " Twitter : https://twitter.com/linuxnetdata\n" + " Twitter : https://twitter.com/netdatahq\n" " LinkedIn : https://linkedin.com/company/netdata-cloud/\n" " Facebook : https://facebook.com/linuxnetdata/\n" "\n" @@ -787,8 +787,7 @@ int help(int exitcode) { " -W stacksize=N Set the stacksize (in bytes).\n\n" " -W debug_flags=N Set runtime tracing to debug.log.\n\n" " -W unittest Run internal unittests and exit.\n\n" - " -W sqlite-check Check metadata database integrity and exit.\n\n" - " -W sqlite-fix Check metadata database integrity, fix if needed and exit.\n\n" + " -W sqlite-meta-recover Run recovery on the metadata database and exit.\n\n" " -W sqlite-compact Reclaim metadata database unused space and exit.\n\n" #ifdef ENABLE_DBENGINE " -W createdataset=N Create a DB engine dataset of N seconds and exit.\n\n" @@ -875,6 +874,10 @@ static void log_init(void) { setenv("NETDATA_ERRORS_THROTTLE_PERIOD", config_get(CONFIG_SECTION_LOGS, "errors flood protection period" , ""), 1); setenv("NETDATA_ERRORS_PER_PERIOD", config_get(CONFIG_SECTION_LOGS, "errors to trigger flood protection", ""), 1); + + char *selected_level = config_get(CONFIG_SECTION_LOGS, "severity level", NETDATA_LOG_LEVEL_INFO_STR); + global_log_severity_level = log_severity_string_to_severity_level(selected_level); + setenv("NETDATA_LOG_SEVERITY_LEVEL", selected_level , 1); } char *initialize_lock_directory_path(char *prefix) @@ -1436,13 +1439,9 @@ int main(int argc, char **argv) { char* createdataset_string = "createdataset="; char* stresstest_string = "stresstest="; #endif - if(strcmp(optarg, "sqlite-check") == 0) { - sql_init_database(DB_CHECK_INTEGRITY, 0); - return 0; - } - if(strcmp(optarg, "sqlite-fix") == 0) { - sql_init_database(DB_CHECK_FIX_DB, 0); + if(strcmp(optarg, "sqlite-meta-recover") == 0) { + sql_init_database(DB_CHECK_RECOVER, 0); return 0; } @@ -1509,7 +1508,7 @@ int main(int argc, char **argv) { unittest_running = true; return aral_unittest(10000); } - else if(strcmp(optarg, "stringtest") == 0) { + else if(strcmp(optarg, "stringtest") == 0) { unittest_running = true; return string_unittest(10000); } @@ -1898,6 +1897,7 @@ int main(int argc, char **argv) { // initialize the log files open_all_log_files(); + netdata_log_info("Netdata agent version \""VERSION"\" is starting"); ieee754_doubles = is_system_ieee754_double(); @@ -1909,6 +1909,8 @@ int main(int argc, char **argv) { replication_initialize(); + rrd_functions_inflight_init(); + // -------------------------------------------------------------------- // get the certificate and start security @@ -1938,8 +1940,6 @@ int main(int argc, char **argv) { signals_block(); signals_init(); // setup the signals we want to use - dyn_conf_init(); - // -------------------------------------------------------------------- // check which threads are enabled and initialize them @@ -2005,6 +2005,8 @@ int main(int argc, char **argv) { if(become_daemon(dont_fork, user) == -1) fatal("Cannot daemonize myself."); + dyn_conf_init(); + netdata_log_info("netdata started on pid %d.", getpid()); delta_startup_time("initialize threads after fork"); |