]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Enable linger earlier for podman 2402/head
authorZack Cerza <zack@cerza.org>
Tue, 15 Jul 2025 17:35:18 +0000 (11:35 -0600)
committerZack Cerza <zack@cerza.org>
Tue, 15 Jul 2025 17:35:18 +0000 (11:35 -0600)
Signed-off-by: Zack Cerza <zack@cerza.org>
scripts/setup_container_runtime.sh

index 375bcaad1d3b80187f1302c89f27e5cfafac4bb5..c1634fda92ba45d52aaad413d7057adbd773f544 100755 (executable)
@@ -2,6 +2,9 @@
 # vim: ts=4 sw=4 expandtab
 function setup_container_runtime () {
   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" -lt 4 ]; then
       echo "Found a very old podman; removing"
@@ -25,9 +28,6 @@ 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"