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:
parent
541e3b09ed
commit
a92768157c
1 changed files with 2 additions and 10 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue