ansible/roles/base: Set XDG_RUNTIME_DIR as required by systemd
[noc.git] / ansible / roles / base / files / xdg_runtime_dir.sh
diff --git a/ansible/roles/base/files/xdg_runtime_dir.sh b/ansible/roles/base/files/xdg_runtime_dir.sh
new file mode 100644 (file)
index 0000000..d2428b1
--- /dev/null
@@ -0,0 +1,4 @@
+# Set XDG_RUNTIME_DIR correctly
+if [ "$UID" -ne 0 ] && [ -z "${XDG_RUNTIME_DIR}" ]; then
+    export XDG_RUNTIME_DIR="/run/user/$(id -u)"
+fi