aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-06 11:48:19 -0500
committerJesse Luehrs <doy@tozt.net>2021-03-06 11:56:37 -0500
commit0cbbf3b2e90c64748a180ae710ad798954cb89fa (patch)
tree97a717e01dfa5a2be767f1e7add6dfda977b0a28
parent1302a9ff57ddd85fa2294a5b13c454279938b8e9 (diff)
downloadrbw-0cbbf3b2e90c64748a180ae710ad798954cb89fa.tar.gz
rbw-0cbbf3b2e90c64748a180ae710ad798954cb89fa.zip
disable PTRACE_ATTACH after daemonizing
this should let warnings go to the agent logs instead of the terminal
-rw-r--r--CHANGELOG.md7
-rw-r--r--src/bin/rbw-agent/main.rs8
2 files changed, 11 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4849a0e..36c8b06 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
# Changelog
+## [Unreleased]
+
+### Fixed
+
+* Send warnings about failure to disable PTRACE_ATTACH to the agent logs rather
+ than stderr
+
## [1.1.1] - 2021-03-05
### Fixed
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