From 5d07c39b149797c710ff09abda3ad90da231d53e Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Thu, 3 Nov 2022 12:00:00 +0000 Subject: [PATCH] nixos/power-management: fix deadlock with post-resume.{target,service} Fixes a deadlock where post-resume.target has After=post-resume.service and post-resume.service runs systemctl try-restart post-resume.target the systemctl call cannot complete if post-resume.target was already queued at that time. --- nixos/modules/config/power-management.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/config/power-management.nix b/nixos/modules/config/power-management.nix index a4e8028cfbe9..e7fd02920e0d 100644 --- a/nixos/modules/config/power-management.nix +++ b/nixos/modules/config/power-management.nix @@ -94,7 +94,7 @@ in after = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ]; script = '' - /run/current-system/systemd/bin/systemctl try-restart post-resume.target + /run/current-system/systemd/bin/systemctl try-restart --no-block post-resume.target ${cfg.resumeCommands} ${cfg.powerUpCommands} '';