GNU bug report logs - #75049
[PATCH] services: rootless-podman: Fix PATH lookup for Shepherd services.

Previous Next

Package: guix-patches;

Reported by: Giacomo Leidi <goodoldpaul <at> autistici.org>

Date: Mon, 23 Dec 2024 14:34:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#75049: closed ([PATCH] services: rootless-podman: Fix PATH
 lookup for Shepherd services.)
Date: Wed, 25 Dec 2024 22:35:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 25 Dec 2024 23:34:11 +0100
with message-id <875xn72xzw.fsf <at> gnu.org>
and subject line Re: [bug#75049] [PATCH] services: rootless-podman: Fix PATH lookup for Shepherd services.
has caused the debbugs.gnu.org bug report #75049,
regarding [PATCH] services: rootless-podman: Fix PATH lookup for Shepherd services.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
75049: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75049
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Giacomo Leidi <goodoldpaul <at> autistici.org>
To: guix-patches <at> gnu.org
Cc: Giacomo Leidi <goodoldpaul <at> autistici.org>
Subject: [PATCH] services: rootless-podman: Fix PATH lookup for Shepherd
 services.
Date: Mon, 23 Dec 2024 15:33:20 +0100
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
---
 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 03f0649c0d..d8f533f44c 100644
--- a/gnu/services/containers.scm
+++ b/gnu/services/containers.scm
@@ -17,6 +17,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (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 @@ (define (cgroups-fs-owner-entrypoint config)
     (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 @@ (define (rootless-podman-cgroups-fs-owner-service config)
 (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 @@ (define (rootless-podman-cgroups-limits-service config)
 (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))

base-commit: 1a55fa23d881a1816ebd05ebdacc55746a8c8ab9
-- 
2.46.0



[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Giacomo Leidi <goodoldpaul <at> autistici.org>
Cc: 75049-done <at> debbugs.gnu.org
Subject: Re: [bug#75049] [PATCH] services: rootless-podman: Fix PATH lookup
 for Shepherd services.
Date: Wed, 25 Dec 2024 23:34:11 +0100
Giacomo Leidi <goodoldpaul <at> autistici.org> skribis:

> 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

Applied, thanks!


This bug report was last modified 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.