From 6f3208b5993f110aa86adb010b82e5d77ef8dfed Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 26 Jun 2018 19:11:29 +0200 Subject: runtime: change rootless data storage default path Signed-off-by: Giuseppe Scrivano Closes: #936 Approved by: rhatdan --- cmd/podman/libpodruntime/runtime.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'cmd/podman/libpodruntime') diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go index abe0115e9..b48667653 100644 --- a/cmd/podman/libpodruntime/runtime.go +++ b/cmd/podman/libpodruntime/runtime.go @@ -25,16 +25,15 @@ func GetRootlessStorageOpts() (storage.StoreOptions, error) { opts.RunRoot = filepath.Join(libpod.GetRootlessRuntimeDir(), "run") - dataDir := os.Getenv("XDG_DATA_DIR") - if dataDir != "" { - opts.GraphRoot = filepath.Join(dataDir, "containers", "storage") - } else { + dataDir := os.Getenv("XDG_DATA_HOME") + if dataDir == "" { home := os.Getenv("HOME") if home == "" { - return opts, fmt.Errorf("HOME not specified") + return opts, fmt.Errorf("neither XDG_DATA_HOME nor HOME was set non-empty") } - opts.GraphRoot = filepath.Join(home, ".containers", "storage") + dataDir = filepath.Join(home, ".local", "share") } + opts.GraphRoot = filepath.Join(dataDir, "containers", "storage") opts.GraphDriverName = "vfs" return opts, nil } -- cgit v1.2.3-54-g00ecf