From f26674696e4cdacffcb3675caa5164cec4a02e67 Mon Sep 17 00:00:00 2001
From: Manuel Amador (Rudd-O) <rudd-o@rudd-o.com>
Date: Mon, 13 Jul 2009 20:06:58 -0500
Subject: [PATCH 2/2] Skip starting PulseAudio session daemon at session logon if a pulseaudio server has been started in system-wide mode, or a specific pulseaudio server has been set as system-wide policy by the system administrator.
---
src/daemon/start-pulseaudio-x11.in | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/src/daemon/start-pulseaudio-x11.in b/src/daemon/start-pulseaudio-x11.in
index c57c489..eab6fe7 100755
|
a
|
b
|
|
| 19 | 19 | |
| 20 | 20 | set -e |
| 21 | 21 | |
| | 22 | # Skip starting the server if a client endpoint variable has been set for this session. |
| 22 | 23 | [ -z "$PULSE_SERVER" ] |
| 23 | 24 | |
| | 25 | # Skip starting the server if a server is running in system-wide mode. |
| | 26 | # Otherwise this user's session server will catfight the system-wide server. |
| | 27 | # This covers the scenario of terminal servers with system-wide sound |
| | 28 | # servers and the scenario of people willing to sacrifice some security |
| | 29 | # and functionality for a system-wide server that lets them listen to apps ike |
| | 30 | # MPD or text-to-speech notifications in the console, in parallel with |
| | 31 | # graphical desktop applications. |
| | 32 | [ -f "@PA_SYSTEM_RUNTIME_PATH@/pid" ] && exit 0 |
| | 33 | |
| | 34 | # Exit if the user has no client.conf and the system client.conf sets a default server. |
| | 35 | # This covers the scenario of terminal servers and machines that exclusively |
| | 36 | # use a remote audio server (say, connected to a stereo) in a fixed |
| | 37 | # configuration. |
| | 38 | # If, however, the user has a client.conf, we continue to server start |
| | 39 | # because we assume the user knows what he is doing, has overridden |
| | 40 | # default system policy, and wants a local server to be started anyway. |
| | 41 | # This exception is in compliance with observations in bug 606. |
| | 42 | if [ ! -f ~/.pulse/client.conf ] ; then |
| | 43 | if [ -x /bin/grep -a -f "@PA_DEFAULT_CONFIG_DIR@/client.conf" ] ; then |
| | 44 | /bin/grep -q "^ *default-server *=" "@PA_DEFAULT_CONFIG_DIR@/client.conf" && exit 0 |
| | 45 | fi |
| | 46 | fi |
| | 47 | |
| 24 | 48 | @PA_BINARY@ --start "$@" |
| 25 | 49 | |
| 26 | 50 | if [ x"$DISPLAY" != x ] ; then |