Re: Pipewire needs turnstile to be enabled as a user service
Reply #5 –
Well, no need for turnstiled, neither loginctl for just that. I don't have any, first on rc.local (given my boxes' settings /etc/local.d/rc.start):
# XDG_RUNTIME_DIR for each user
declare -A users=( [<user_0>]=<user_0_default_group> )
for _user in "${users[@]}" ; do
if [ "$(id -u "$_user")" ] && [ "$(id -g "$_user")" ]; then
XDG_RUNTIME_DIR="/run/user/$(id -u "$_user")"
if [ -d "$XDG_RUNTIME_DIR" ]; then
rm -rf "$XDG_RUNTIME_DIR"
fi
mkdir -p "$XDG_RUNTIME_DIR"
chown ${_user}:${users["$_user"]} "${XDG_RUNTIME_DIR}"
chmod 700 "$XDG_RUNTIME_DIR"
fi
done
Where users is an associative list of users with username as key and default group as value. So on boot all users directories are created. Now that can move to you ~/.bash_profile or ~/.profile if you prefer. And then I have in my ~/.bash_profile:
if [ -n "$PS1" ]; then
XDG_RUNTIME_DIR="/run/user/$(id -u)"
export XDG_RUNTIME_DIR
...
fi
So no need for any session helper stuff to get that. Now my approach of having the directories ready right at boot, which is not necessary, comes from the idea of possible headless jobs running as users and not root, which might potentially depend on XDG_RUN_TIME being up and running.
That said, I no longer use pipewire (I was, as requirement for wayland screen sharing) neither wayland, plain alsa and x11 without dbus now,