From 8942f6b40248743e872394ea3920c2c3db396750 Mon Sep 17 00:00:00 2001 From: Ihor Kalnytskyi Date: Sun, 27 Dec 2020 13:32:28 +0200 Subject: [PATCH] launch: avoid autostarting pipewire-pulse systemd units for root Long story short, this is something pulseaudio has since 2017 [1]. If pipewire-pulse is aiming to be a drop-in replacement, the same behaviour is probably expected. I noticed that without this line I hit some issues with systemd socket activation. In fact, it does not work properly at all. It probably has something to do with the fact that pipewire-pulse is started for GDM session and is somehow propagated down to my own user session. [1] https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/24928d6b6fa1cde3312bcf63e4e14d7003aadc69 --- src/daemon/systemd/user/pipewire-pulse.service.in | 1 + src/daemon/systemd/user/pipewire-pulse.socket | 1 + 2 files changed, 2 insertions(+) diff --git a/src/daemon/systemd/user/pipewire-pulse.service.in b/src/daemon/systemd/user/pipewire-pulse.service.in index 742abdeb5..252716170 100644 --- a/src/daemon/systemd/user/pipewire-pulse.service.in +++ b/src/daemon/systemd/user/pipewire-pulse.service.in @@ -14,6 +14,7 @@ Description=PipeWire PulseAudio # After=pipewire-pulse.socket is not needed, as it is already implicit in the # socket-service relationship, see systemd.socket(5). Requires=pipewire-pulse.socket +ConditionUser=!root [Service] Type=simple diff --git a/src/daemon/systemd/user/pipewire-pulse.socket b/src/daemon/systemd/user/pipewire-pulse.socket index fd04895fa..16ed715ea 100644 --- a/src/daemon/systemd/user/pipewire-pulse.socket +++ b/src/daemon/systemd/user/pipewire-pulse.socket @@ -1,5 +1,6 @@ [Unit] Description=PipeWire PulseAudio +ConditionUser=!root [Socket] Priority=6