From d44e7df8cf8ef0db4c2bfd85077ddce3f7f78211 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 12 Jan 2024 08:02:48 -0600 Subject: [PATCH] nut: Pass explicit path to systemd-sysusers When `tmpl` substitutes the path of the generated file for `%s` in hook commands, it uses the full path including the `destdir` prefix. Since we're running `tmpl` inside a container, but `systemd-sysusers` outside it (via `nsenter -t 1`), that path is not correct. Thus, we need to explicitly pass the path as `systemd-sysusers` will see it. --- pkg/nut/templates.k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/nut/templates.k b/pkg/nut/templates.k index dab07bb..81cc424 100644 --- a/pkg/nut/templates.k +++ b/pkg/nut/templates.k @@ -4,7 +4,7 @@ templates = [ dest = "/etc/sysusers.d/nut.conf" hooks = { changed = [{ - run = "systemd-sysusers %s" + run = "systemd-sysusers /etc/sysusers.d/nut.conf" immediate = True }] }