From 27a72d991305cfd9b15018a6e7eb3db93a32bc60 Mon Sep 17 00:00:00 2001 From: Tarow Date: Wed, 19 Mar 2025 20:09:57 +0100 Subject: [PATCH] podman: include systemd in quadlet service path Podman uses systemd-run to setup transient systemd timers, e.g. for healthchecks. On systems where systemd is not present in /run/current-system/sw/bin or ~/.nix-profile/bin (like one of my Ubuntu hosts), setting up the transient timers will fail. For containers with healthchecks configured, this results in the container being stuck in starting state. Relevant issue here: containers/podman#25034 --- modules/services/podman-linux/containers.nix | 1 + tests/modules/services/podman-linux/container-expected.service | 2 +- .../podman-linux/integration-container-bld-expected.service | 2 +- .../podman-linux/integration-container-expected.service | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/services/podman-linux/containers.nix b/modules/services/podman-linux/containers.nix index 470eb0a7f..586bcf660 100644 --- a/modules/services/podman-linux/containers.nix +++ b/modules/services/podman-linux/containers.nix @@ -103,6 +103,7 @@ let "/run/wrappers/bin" "/run/current-system/sw/bin" "${config.home.homeDirectory}/.nix-profile/bin" + "${pkgs.systemd}/bin" ]); }; Restart = "always"; diff --git a/tests/modules/services/podman-linux/container-expected.service b/tests/modules/services/podman-linux/container-expected.service index df5bcb2a0..7d5072de9 100644 --- a/tests/modules/services/podman-linux/container-expected.service +++ b/tests/modules/services/podman-linux/container-expected.service @@ -27,7 +27,7 @@ WantedBy=default.target WantedBy=multi-user.target [Service] -Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin +Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin Restart=on-failure TimeoutStopSec=30 Environment=PODMAN_SYSTEMD_UNIT=%n diff --git a/tests/modules/services/podman-linux/integration-container-bld-expected.service b/tests/modules/services/podman-linux/integration-container-bld-expected.service index 520e53ee0..582290179 100644 --- a/tests/modules/services/podman-linux/integration-container-bld-expected.service +++ b/tests/modules/services/podman-linux/integration-container-bld-expected.service @@ -15,7 +15,7 @@ WantedBy=default.target WantedBy=multi-user.target [Service] -Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin +Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin Restart=always TimeoutStopSec=30 Environment=PODMAN_SYSTEMD_UNIT=%n diff --git a/tests/modules/services/podman-linux/integration-container-expected.service b/tests/modules/services/podman-linux/integration-container-expected.service index 549bf7dc5..4b42e55cc 100644 --- a/tests/modules/services/podman-linux/integration-container-expected.service +++ b/tests/modules/services/podman-linux/integration-container-expected.service @@ -18,7 +18,7 @@ WantedBy=default.target WantedBy=multi-user.target [Service] -Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin +Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin Restart=always TimeoutStopSec=30 Environment=PODMAN_SYSTEMD_UNIT=%n