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.
This commit is contained in:
Guillaume Girol 2022-11-03 12:00:00 +00:00
parent d40fea9aeb
commit 5d07c39b14

View File

@ -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}
'';