From 7cf89393c267cc6df42990fddcf8c85a2fe146f6 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 15 Sep 2021 21:57:00 +0200 Subject: [PATCH] Try to daemonize after tokio's runtime has been built --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 3f6b19c..756fd50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -550,13 +550,15 @@ fn main() -> Result<(), Error> { std::process::exit(1); }) .unwrap(); - privdrop(&config)?; + let mut runtime_builder = tokio::runtime::Builder::new_multi_thread(); runtime_builder.enable_all(); runtime_builder.thread_name("encrypted-dns-"); let runtime = runtime_builder.build()?; + privdrop(&config)?; + let key_cache_capacity = config.dnscrypt.key_cache_capacity; let cache_capacity = config.cache_capacity; let state_file = &config.state_file;