logging and config sweep

This commit is contained in:
lda committed 2026-04-11 18:02:12 +07:00
1 parent ce1c0c0558
commit 78b12ad0ee
16 files changed
+839 -97

No files matched your search

+3
View File
@@ -16,6 +16,7 @@ pub async fn serve(args: ServeArgs) -> Result<()> {
}
write_pid_file(&args.pid_file)?;
info!(pid_file = %args.pid_file.display(), "wrote wakey-agent pid file");
let mut cfg = config::load_config(&args.config)?;
info!(config_path = %args.config.display(), agent_id = %cfg.agent_id, "starting wakey-agent");
@@ -48,6 +49,7 @@ pub async fn serve(args: ServeArgs) -> Result<()> {
}
}
join = &mut worker => {
warn!("agent worker task exited; shutting down daemon");
let _ = remove_pid_file(&args.pid_file);
return join.context("agent session join failed")?;
}
@@ -69,6 +71,7 @@ pub async fn serve(args: ServeArgs) -> Result<()> {
pub fn reload_daemon(pid_file: &Path) -> Result<()> {
let pid = read_pid(pid_file)?;
info!(pid, pid_file = %pid_file.display(), "sending wakey-agent reload signal");
send_hup(pid)
}