diff --git a/CHANGELOG.md b/CHANGELOG.md index 24866fb9..0becc56e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fix reading of configuration files that lacks a `shared` section. +- Made the daemon exit gracefully (exit code 0) on SIGINT and SIGTEM. + ## [3.3.3] - 2024-01-04 ### Fixed diff --git a/pueue/src/daemon/mod.rs b/pueue/src/daemon/mod.rs index c8789bee..cc411f5b 100644 --- a/pueue/src/daemon/mod.rs +++ b/pueue/src/daemon/mod.rs @@ -145,7 +145,7 @@ fn setup_signal_panic_handling(settings: &Settings, sender: &TaskSender) -> Resu ctrlc::set_handler(move || { // Notify the task handler sender_clone - .send(Shutdown::Emergency) + .send(Shutdown::Graceful) .expect("Failed to send Message to TaskHandler on Shutdown"); })?; diff --git a/pueue/tests/daemon/integration/shutdown.rs b/pueue/tests/daemon/integration/shutdown.rs index 2f7422e5..cb58ad1e 100644 --- a/pueue/tests/daemon/integration/shutdown.rs +++ b/pueue/tests/daemon/integration/shutdown.rs @@ -21,7 +21,7 @@ async fn test_ctrlc() -> Result<()> { let result = child.try_wait(); assert!(matches!(result, Ok(Some(_)))); let code = result.unwrap().unwrap(); - assert!(matches!(code.code(), Some(1))); + assert!(matches!(code.code(), Some(0))); Ok(()) }