diff options
author | Himbeer <himbeer@disroot.org> | 2024-08-31 13:20:09 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-08-31 13:20:09 +0200 |
commit | 20cee7ffac3c4486b4fc5f19fd27e508be4aa3c5 (patch) | |
tree | 33f613d2692c5e6209c258ab67800ff7a964deac | |
parent | dc131fd1d636e0c203e7b12b0801f741d234539d (diff) |
Write crash logs to non-volatile storage
This aids in debugging failures that cause the device to become
unreachable over the network by reading the data partition using a
different device. Regular logs cause dangerously many writes to the SD
cards of Raspberry Pis and will remain in volatile storage. If
necessary, services should switch to eprintln for non-volatile logging.
-rw-r--r-- | src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 1579f3b..41ba816 100644 --- a/src/main.rs +++ b/src/main.rs @@ -169,7 +169,7 @@ fn log_out(pipe: ChildStdout, service_name: String) -> Result<()> { } fn log_err(pipe: ChildStderr, service_name: String) -> Result<()> { - let mut file = File::create(Path::new("/tmp").join(service_name.clone() + ".err"))?; + let mut file = File::create(Path::new("/data").join(service_name.clone() + ".err"))?; let mut r = BufReader::new(pipe); loop { |