From 5aaf57c9bb062caee880cad41eac6d2e2888284d Mon Sep 17 00:00:00 2001 From: EliasSchriefer Date: Sun, 30 Aug 2020 19:41:13 +0200 Subject: [PATCH] Add comment/code documentation --- sfsmcd/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sfsmcd/src/main.rs b/sfsmcd/src/main.rs index a40f589..744e1f6 100644 --- a/sfsmcd/src/main.rs +++ b/sfsmcd/src/main.rs @@ -55,6 +55,8 @@ async fn main() -> Result<(), Box> { // Will (afaik) be stabilized in Rust 1.48 // core::future::pending::<()>().await; + + // Wait until SIGTERM (when systemd stops this service), then shutdown tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())?.recv().await; info!("Got SIGTERM, shutting down"); Ok(())