From a75b2d614a405b7ba11797377d6eb140519b84ee Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Mon, 23 Dec 2024 15:33:20 +0100 Subject: [PATCH] services: rootless-podman: Fix PATH lookup for Shepherd services. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One-shot Shepherd services required to correctly setup Podman in the Guix System, are failing to find executables upon boot. This patch changes the executable references to absolute paths to avoid PATH lookup. * gnu/services/containers.scm (cgroups-fs-owner-entrypoint): Hardcode bash path; (rootless-podman-cgroups-fs-owner-service): Ditto; (rootless-podman-fs-entrypoint): Hardcode mount path. Change-Id: Id6a27cadf51326ce57af93f57809b77e28dbeaef Signed-off-by: Ludovic Courtès --- gnu/services/containers.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gnu/services/containers.scm b/gnu/services/containers.scm index 03f0649c0d3440d299c032e1d9d4a8f857c0ab9c..d8f533f44c08a2826942905f40d7f1228cd75bf3 100644 --- a/gnu/services/containers.scm +++ b/gnu/services/containers.scm @@ -17,6 +17,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu services containers) + #:use-module (gnu packages bash) #:use-module (gnu packages containers) #:use-module (gnu packages file-systems) #:use-module (gnu services) @@ -134,7 +135,7 @@ available for each configured user.")) (rootless-podman-configuration-group-name config)) (program-file "cgroups2-fs-owner-entrypoint" #~(system* - "bash" "-c" + (string-append #+bash-minimal "/bin/bash") "-c" (string-append "echo Setting /sys/fs/cgroup " "group ownership to " #$group " && chown -v " "root:" #$group " /sys/fs/cgroup && " @@ -166,7 +167,7 @@ available for each configured user.")) (define cgroups-limits-entrypoint (program-file "cgroups2-limits-entrypoint" #~(system* - "bash" "-c" + (string-append #+bash-minimal "/bin/bash") "-c" (string-append "echo Setting cgroups v2 limits && " "echo +cpu +cpuset +memory +pids" " >> /sys/fs/cgroup/cgroup.subtree_control")))) @@ -194,7 +195,7 @@ pids.") (define rootless-podman-shared-root-fs-entrypoint (program-file "rootless-podman-shared-root-fs-entrypoint" #~(system* - "mount" "--make-shared" "/"))) + "/run/privileged/bin/mount" "--make-shared" "/"))) (define (rootless-podman-shared-root-fs-service config) (shepherd-service (provision '(rootless-podman-shared-root-fs))