From d948f8b75237669448438935e1a05ffa98faeafa Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 24 Jul 2025 12:21:05 +0200 Subject: [PATCH] Move StartLimit* options to unit section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The StartLimitBurst and StartLimitIntervalSec options belong to the [Unit] section, otherwise they are ignored in [Service]: > Unknown key 'StartLimitIntervalSec' in section [Service], ignoring. When using [Unit], the limits are properly set: apex% systemctl show power-policy.service | grep StartLimit StartLimitIntervalUSec=10min StartLimitBurst=10 StartLimitAction=none Reviewed-by: Aleix Boné --- m/module/power-policy.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/m/module/power-policy.nix b/m/module/power-policy.nix index 87c04140..61dcd01c 100644 --- a/m/module/power-policy.nix +++ b/m/module/power-policy.nix @@ -18,13 +18,15 @@ in systemd.services."power-policy" = { description = "Set power policy to use via IPMI"; wantedBy = [ "multi-user.target" ]; + unitConfig = { + StartLimitBurst = "10"; + StartLimitIntervalSec = "10m"; + }; serviceConfig = { ExecStart = "${pkgs.ipmitool}/bin/ipmitool chassis policy ${cfg}"; Type = "oneshot"; Restart = "on-failure"; RestartSec = "5s"; - StartLimitBurst = "10"; - StartLimitIntervalSec = "10m"; }; }; };