summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/daemon/main.c b/daemon/main.c
index 0d067c86a0..e5ab9d13a1 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -327,6 +327,14 @@ void netdata_cleanup_and_exit(int ret) {
snprintfz(agent_incomplete_shutdown_file, FILENAME_MAX, "%s/.agent_incomplete_shutdown", netdata_configured_varlib_dir);
(void) rename(agent_crash_file, agent_incomplete_shutdown_file);
+#ifdef ENABLE_DBENGINE
+ if(dbengine_enabled) {
+ delta_shutdown_time("dbengine exit mode");
+ for (size_t tier = 0; tier < storage_tiers; tier++)
+ rrdeng_exit_mode(multidb_ctx[tier]);
+ }
+#endif
+
delta_shutdown_time("disable maintenance, new queries, new web requests, new streaming connections and aclk");
service_signal_exit(
@@ -604,7 +612,7 @@ static void set_nofile_limit(struct rlimit *rl) {
// make the soft/hard limits equal
rl->rlim_cur = rl->rlim_max;
if (setrlimit(RLIMIT_NOFILE, rl) != 0) {
- error("setrlimit(RLIMIT_NOFILE, { %llu, %llu }) failed", rl->rlim_cur, rl->rlim_max);
+ error("setrlimit(RLIMIT_NOFILE, { %zu, %zu }) failed", (size_t)rl->rlim_cur, (size_t)rl->rlim_max);
}
// sanity check to make sure we have enough file descriptors available to open
@@ -614,7 +622,7 @@ static void set_nofile_limit(struct rlimit *rl) {
}
if (rl->rlim_cur < 1024)
- error("Number of open file descriptors allowed for this process is too low (RLIMIT_NOFILE=%zu)", (size_t) rl->rlim_cur);
+ error("Number of open file descriptors allowed for this process is too low (RLIMIT_NOFILE=%zu)", (size_t)rl->rlim_cur);
}
void cancel_main_threads() {