From 38e450902fa6d179edca79a03f031afa16188b3e Mon Sep 17 00:00:00 2001 From: Willow Barraco Date: Wed, 11 Oct 2023 17:19:34 +0200 Subject: [PATCH] Prefer /run/user instead of /var/run/user --- configs/profile.d/sxmo_init.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/configs/profile.d/sxmo_init.sh b/configs/profile.d/sxmo_init.sh index 44af071..a406a9e 100644 --- a/configs/profile.d/sxmo_init.sh +++ b/configs/profile.d/sxmo_init.sh @@ -39,10 +39,14 @@ _sxmo_find_runtime_dir() { return fi - if [ -d "/var/run/user/$(id -u)" ]; then - printf "/var/run/user/%s" "$(id -u)" - return - fi + # Try something existing + for root in /run /var/run; do + path="$root/user/$(id -u)" + if [ -d "$path" ] && [ -w "$path" ]; then + printf %s "$path" + return + fi + done # Fallback to a shared memory location printf "/dev/shm/user/%s" "$(id -u)"