diff options
author | flouthoc <flouthoc.git@gmail.com> | 2021-08-26 16:20:11 +0530 |
---|---|---|
committer | Aditya Rajan <flouthoc.git@gmail.com> | 2021-08-30 16:43:14 +0530 |
commit | 9b7ef3dad1f8fad2be3f069039673d9860687aea (patch) | |
tree | 52a633072c57cb67051e5d94ede2e6f0fbe6359c /libpod | |
parent | 49cfed756f5dfb6d9267eb29d31f651578c9037c (diff) | |
download | podman-9b7ef3dad1f8fad2be3f069039673d9860687aea.tar.gz podman-9b7ef3dad1f8fad2be3f069039673d9860687aea.tar.bz2 podman-9b7ef3dad1f8fad2be3f069039673d9860687aea.zip |
runtime: Warn if XDG_RUNTIME_DIR is set but is not writable.
[NO TESTS NEEDED]
Signed-off-by: Aditya Rajan <flouthoc.git@gmail.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index c5f5db531..1c9c56d16 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -15,6 +15,8 @@ import ( "syscall" "time" + "golang.org/x/sys/unix" + "github.com/containers/buildah/pkg/parse" "github.com/containers/common/libimage" "github.com/containers/common/pkg/config" @@ -328,6 +330,16 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) { runtime.mergeDBConfig(dbConfig) + unified, _ := cgroups.IsCgroup2UnifiedMode() + if unified && rootless.IsRootless() && !systemd.IsSystemdSessionValid(rootless.GetRootlessUID()) { + // If user is rootless and XDG_RUNTIME_DIR is found, podman will not proceed with /tmp directory + // it will try to use existing XDG_RUNTIME_DIR + // if current user has no write access to XDG_RUNTIME_DIR we will fail later + if unix.Access(runtime.storageConfig.RunRoot, unix.W_OK) != nil { + logrus.Warnf("XDG_RUNTIME_DIR is pointing to a path which is not writable. Most likely podman will fail.") + } + } + logrus.Debugf("Using graph driver %s", runtime.storageConfig.GraphDriverName) logrus.Debugf("Using graph root %s", runtime.storageConfig.GraphRoot) logrus.Debugf("Using run root %s", runtime.storageConfig.RunRoot) |