From 16bd35de5a1c0502a30b9312e249ea7fd7b056e3 Mon Sep 17 00:00:00 2001 From: Marco Scardovi Date: Mon, 29 Jun 2026 22:07:52 +0200 Subject: [PATCH] fix(asus-shutdown): exit cleanly on SIGTERM When asus-shutdown receives a SIGTERM outside of system shutdown (e.g. during manual service management or package update restarts), it ignored the signal and looped indefinitely waiting for logind's PrepareForShutdown signal. Combined with SendSIGKILL=no in the systemd service file, this caused commands like systemctl stop/restart asus-shutdown to hang indefinitely. This patch makes asus-shutdown break the select loop and exit cleanly upon receiving SIGTERM. Since settings application is run synchronously within the event branch, SIGTERM will not interrupt an ongoing GPU firmware write. Closes: https://github.com/OpenGamingCollective/asusctl/issues/140 --- asus-shutdown/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asus-shutdown/src/main.rs b/asus-shutdown/src/main.rs index 1b80818c..569fc485 100644 --- a/asus-shutdown/src/main.rs +++ b/asus-shutdown/src/main.rs @@ -96,8 +96,8 @@ async fn main() -> Result<(), Box> { loop { tokio::select! { _ = sigterm.recv() => { - warn!("Received SIGTERM"); - warn!("Deferring exit until deferred shutdown apply reaches a safe completion point"); + warn!("Received SIGTERM, exiting cleanly"); + break; } event = shutdown_events.next() => { match event {