Skip to content

Commit ca9ffdf

Browse files
authored
Merge pull request #178 from AkihiroSuda/rootless-safe-fallback
rootless-install.sh: use safer XRD on non-systemd hosts
2 parents 3d1b8a8 + ebbfa9e commit ca9ffdf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rootless-install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ checks() {
101101
>&2 echo "- or simply log back in as the desired unprivileged user (ssh works for remote machines)"
102102
exit 1
103103
fi
104-
export XDG_RUNTIME_DIR="/tmp/docker-$(id -u)"
105-
mkdir -p "$XDG_RUNTIME_DIR"
104+
export XDG_RUNTIME_DIR="$HOME/.docker/run"
105+
mkdir -p -m 700 "$XDG_RUNTIME_DIR"
106106
XDG_RUNTIME_DIR_CREATED=1
107107
fi
108108

@@ -307,6 +307,7 @@ print_instructions() {
307307
echo "# Make sure the following environment variables are set (or add them to ~/.bashrc):\n"
308308

309309
if [ -n "$XDG_RUNTIME_DIR_CREATED" ]; then
310+
echo "# WARN: systemd not found. You have to remove XDG_RUNTIME_DIR manually on every logout."
310311
echo "export XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR"
311312
fi
312313

0 commit comments

Comments
 (0)