fix hardcoded HOME paths in stop() and check_children()

Both functions used format! with HOME for log paths; when daemon
runs as system user without HOME, logs went to /.local/share/...
Now uses state::log_path() like spawn() does.
This commit is contained in:
Niko Marmeladkov 2026-07-03 14:10:05 +03:00
parent 541e3b09ed
commit a92768157c
Signed by untrusted user who does not match committer: Niko
GPG key ID: E3B955F9442D44E3

View file

@ -222,11 +222,7 @@ fn stop(name: &str, procs: &mut HashMap<String, Proc>) {
};
let pid = p.pid;
let log_path = format!(
"{}/.local/share/rss/logs/{}.log",
std::env::var("HOME").unwrap_or_default(),
name
);
let log_path = crate::state::log_path(name).to_string_lossy().to_string();
// stop_command
if let Some(cmd) = p.cfg.resolve_stop_command(name, pid, &log_path) {
@ -276,11 +272,7 @@ fn check_children(procs: &mut HashMap<String, Proc>) {
for (name, p) in procs.iter_mut() {
if let Ok(Some(status)) = p.child.try_wait() {
let log_path = format!(
"{}/.local/share/rss/logs/{}.log",
std::env::var("HOME").unwrap_or_default(),
name
);
let log_path = crate::state::log_path(name).to_string_lossy().to_string();
let code = status
.code()