From 17eaf83fe80ad7b70ec14b1b92515f8291594f96 Mon Sep 17 00:00:00 2001 From: msizanoen Date: Mon, 10 Mar 2025 20:06:58 +0700 Subject: [PATCH] systemd: Disable pipewire user services for root The `access(2)` based multi-user mediation mechanism doesn't quite work for the root user, which may cause it to conflict with a running foreground user session. Prevent this by not running the user service at all for the root user, which nobody should be doing anyway. --- src/daemon/systemd/user/pipewire.service.in | 1 + src/daemon/systemd/user/pipewire.socket | 1 + 2 files changed, 2 insertions(+) diff --git a/src/daemon/systemd/user/pipewire.service.in b/src/daemon/systemd/user/pipewire.service.in index b9b137351..4236c6bd4 100644 --- a/src/daemon/systemd/user/pipewire.service.in +++ b/src/daemon/systemd/user/pipewire.service.in @@ -14,6 +14,7 @@ Description=PipeWire Multimedia Service # After=pipewire.socket is not needed, as it is already implicit in the # socket-service relationship, see systemd.socket(5). Requires=pipewire.socket +ConditionUser=!root [Service] LockPersonality=yes diff --git a/src/daemon/systemd/user/pipewire.socket b/src/daemon/systemd/user/pipewire.socket index 16e23a7b6..890342abb 100644 --- a/src/daemon/systemd/user/pipewire.socket +++ b/src/daemon/systemd/user/pipewire.socket @@ -1,5 +1,6 @@ [Unit] Description=PipeWire Multimedia System Sockets +ConditionUser=!root [Socket] Priority=6