From 0cbbf3b2e90c64748a180ae710ad798954cb89fa Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 6 Mar 2021 11:48:19 -0500 Subject: disable PTRACE_ATTACH after daemonizing this should let warnings go to the agent logs instead of the terminal --- src/bin/rbw-agent/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/bin/rbw-agent/main.rs b/src/bin/rbw-agent/main.rs index 74ee258..69411ae 100644 --- a/src/bin/rbw-agent/main.rs +++ b/src/bin/rbw-agent/main.rs @@ -29,10 +29,6 @@ fn real_main() -> anyhow::Result<()> { ) .init(); - if let Err(e) = debugger::disable_tracing() { - log::warn!("{}", e); - } - let no_daemonize = if let Some(arg) = std::env::args().nth(1) { arg == "--no-daemonize" } else { @@ -45,6 +41,10 @@ fn real_main() -> anyhow::Result<()> { Some(daemon::daemonize().context("failed to daemonize")?) }; + if let Err(e) = debugger::disable_tracing() { + log::warn!("{}", e); + } + let (w, r) = std::sync::mpsc::channel(); // can't use tokio::main because we need to daemonize before starting the // tokio runloop, or else things break -- cgit v1.2.3-54-g00ecf