]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Enable linger for the Jenkins user 2396/head
authorZack Cerza <zack@cerza.org>
Tue, 8 Jul 2025 16:29:42 +0000 (10:29 -0600)
committerZack Cerza <zack@cerza.org>
Tue, 8 Jul 2025 16:45:04 +0000 (10:45 -0600)
This fixes errors like:
RunRoot is pointing to a path (/run/user/$ID/containers) which is not writable. Most likely podman will fail.
Error: creating events dirs: mkdir /run/user/$ID: permission denied

Signed-off-by: Zack Cerza <zack@cerza.org>
scripts/setup_container_runtime.sh

index 8235d705df5455ff844082625047fa203dde1097..375bcaad1d3b80187f1302c89f27e5cfafac4bb5 100755 (executable)
@@ -25,6 +25,9 @@ function setup_container_runtime () {
   fi
 
   if command -v podman; then
+    if ! [ -d /run/user/$(id -u) -a -w /run/user/$(id -u) ]; then
+      sudo loginctl enable-linger $(id -nu)
+    fi
     PODMAN_MAJOR_VERSION=$(podman version -f json | jq -r '.Client.Version|split(".")[0]')
     if [ "$PODMAN_MAJOR_VERSION" -ge 4 ]; then
       PODMAN_DIR="$HOME/.local/share/containers"