Ticket #606: 0002-Skip-starting-PulseAudio-session-daemon-at-session-l.patch

File 0002-Skip-starting-PulseAudio-session-daemon-at-session-l.patch, 2.2 KB (added by Rudd-O, 3 years ago)

patch that observes colin's complaint about the system-wide client.conf not being read if a client.conf file is present in the user profile

  • src/daemon/start-pulseaudio-x11.in

    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  
    1919 
    2020set -e 
    2121 
     22# Skip starting the server if a client endpoint variable has been set for this session. 
    2223[ -z "$PULSE_SERVER" ] 
    2324 
     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. 
     42if [ ! -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 
     46fi 
     47 
    2448@PA_BINARY@ --start "$@" 
    2549 
    2650if [ x"$DISPLAY" != x ] ; then