From ca69be9335def2e31525ea0dc7abd5062700f5ab Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sun, 5 Feb 2023 11:13:04 +0100 Subject: [PATCH] borgmatic: Do not inhibit idle in service (#3637) This reflects a systemd service sample file change made in borgmatic 1.7.6, commit 2e9f70d49647d47fb4ca05f428c592b0e4319544: When backing up a machine with a monitor using logind to control idle timeout and things like DPMS, borgmatic can block the screen from turning on/off with systemd-inhibit. This is because by default systemd-inhibit will block "idle:sleep:shutdown". Borgmatic does not need to care about idle, only about suspend and shutdown. So, add an explicit `--what` flag for what borgmatic should inhibit. For more information see systemd-inhibit(1). --- modules/services/borgmatic.nix | 1 + tests/modules/services/borgmatic/basic-configuration.service | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/services/borgmatic.nix b/modules/services/borgmatic.nix index f5368cdfc..c2f2963a2 100644 --- a/modules/services/borgmatic.nix +++ b/modules/services/borgmatic.nix @@ -63,6 +63,7 @@ in { ExecStart = '' ${pkgs.systemd}/bin/systemd-inhibit \ --who="borgmatic" \ + --what="sleep:shutdown" \ --why="Prevent interrupting scheduled backup" \ ${programConfig.package}/bin/borgmatic \ --stats \ diff --git a/tests/modules/services/borgmatic/basic-configuration.service b/tests/modules/services/borgmatic/basic-configuration.service index 4840f11bc..80713fd90 100644 --- a/tests/modules/services/borgmatic/basic-configuration.service +++ b/tests/modules/services/borgmatic/basic-configuration.service @@ -2,6 +2,7 @@ CPUSchedulingPolicy=batch ExecStart=/nix/store/00000000000000000000000000000000-systemd/bin/systemd-inhibit \ --who="borgmatic" \ + --what="sleep:shutdown" \ --why="Prevent interrupting scheduled backup" \ @borgmatic@/bin/borgmatic \ --stats \