launch: avoid autostarting pulseaudio systemd units for root
authorFelipe Sateler <fsateler@debian.org>
Wed, 6 Sep 2017 22:55:56 +0000 (19:55 -0300)
committerTanu Kaskinen <tanuk@iki.fi>
Sat, 9 Sep 2017 13:37:39 +0000 (16:37 +0300)
The autospawn mechanism already had a root-autospawn protection mechanism. When
using systemd that was lost. Systemd 234 has a mechanism to conditionalize unit starting
on the running user, so lets do that to protect against root autospawning.

src/daemon/systemd/user/pulseaudio.service.in
src/daemon/systemd/user/pulseaudio.socket

index 2bd780f..46897bf 100644 (file)
@@ -14,6 +14,7 @@ Description=Sound Service
 # After=pulseaudio.socket is not needed, as it is already implicit in the
 # socket-service relationship, see systemd.socket(5).
 Requires=pulseaudio.socket
+ConditionUser=!root
 
 [Service]
 # Note that notify will only work if --daemonize=no
index 332ece8..98c1002 100644 (file)
@@ -1,5 +1,6 @@
 [Unit]
 Description=Sound System
+ConditionUser=!root
 
 [Socket]
 Priority=6