launch: avoid autostarting pulseaudio systemd units for root

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.
This commit is contained in:
Felipe Sateler 2017-09-06 19:55:56 -03:00 committed by Tanu Kaskinen
parent 675a407a0e
commit 24928d6b6f
2 changed files with 2 additions and 0 deletions

View 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

View file

@ -1,5 +1,6 @@
[Unit]
Description=Sound System
ConditionUser=!root
[Socket]
Priority=6