From fe9ac2ca1c4960fcab67a6a7a332ea4876ed3544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Mon, 22 Jul 2013 14:16:18 +0200 Subject: [PATCH] apcupsd-service: workaround for "A stop job is running for UPS daemon" When apcupsd has initiated a shutdown, systemd always ends up waiting for it to stop ("A stop job is running for UPS daemon"). This is weird, because in the journal one can clearly see that apcupsd has received the SIGTERM signal and has already quit (or so it seems). This reduces the wait time from 90 seconds (default) to just 5. Then systemd kills it with SIGKILL. --- modules/services/monitoring/apcupsd.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/services/monitoring/apcupsd.nix b/modules/services/monitoring/apcupsd.nix index 163ae3ceff60..b7da167b187b 100644 --- a/modules/services/monitoring/apcupsd.nix +++ b/modules/services/monitoring/apcupsd.nix @@ -153,6 +153,13 @@ in preStart = "mkdir -p /run/apcupsd/"; serviceConfig = { ExecStart = "${pkgs.apcupsd}/bin/apcupsd -b -f ${configFile} -d1"; + # TODO: When apcupsd has initiated a shutdown, systemd always ends up + # waiting for it to stop ("A stop job is running for UPS daemon"). This + # is weird, because in the journal one can clearly see that apcupsd has + # received the SIGTERM signal and has already quit (or so it seems). + # This reduces the wait time from 90 seconds (default) to just 5. Then + # systemd kills it with SIGKILL. + TimeoutStopSec = 5; }; };