summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-10-17 15:37:33 +0200
committerColin Guthrie <colin@mageia.org>2014-11-03 12:32:23 +0000
commit7276faca72e9696d4891daff139aee52509f43bf (patch)
tree4fcedcd84953709fa3a195629551ab441cd6d3e6
parente542e810041efef6497597ee55b4c7d5c349ba3e (diff)
launch: Disable autospawn by default when systemd daemon support is enabled.
When enabled, this method is prefered over pulseaudio's built in systems so we should try our best to ensure that it cannot be spawned outside of the mechanisms desired. Packagers should call 'systemctl --global enable pulseaudio.socket' to enable the socket for all users, or alternatively ship an enabling symlink in /usr/lib/systemd/user/sockets.target.wants/ folder. It may also make sense for distributions to add in a ConditionNNN= line to the socket unit if they have a downstream mechanism for enabling or disabling pulseaudio. If individual users wish to opt out of this vendor (or administrator) decision, they can call 'systemctl --user mask pulseaudio.socket'
-rw-r--r--configure.ac3
-rw-r--r--man/pulse-client.conf.5.xml.in2
-rw-r--r--src/pulse/client-conf.c4
-rw-r--r--src/pulse/client.conf.in2
4 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 23905adf6..3fa1bc900 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1219,6 +1219,9 @@ AS_IF([test "x$enable_systemd_daemon" != "xno"],
AS_IF([test "x$enable_systemd_daemon" = "xyes" && test "x$HAVE_SYSTEMD_DAEMON" = "x0"],
[AC_MSG_ERROR([*** Needed systemd daemon support not found])])
+AS_IF([test "x$HAVE_SYSTEMD_DAEMON" = "x1"], [ PA_DEFAULT_AUTOSPAWN=no ], [ PA_DEFAULT_AUTOSPAWN=yes ])
+AC_SUBST(PA_DEFAULT_AUTOSPAWN)
+
AC_SUBST(HAVE_SYSTEMD_DAEMON)
AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = x1])
AS_IF([test "x$HAVE_SYSTEMD_DAEMON" = "x1"], AC_DEFINE([HAVE_SYSTEMD_DAEMON], 1, [Have SYSTEMDDAEMON?]))
diff --git a/man/pulse-client.conf.5.xml.in b/man/pulse-client.conf.5.xml.in
index 45f02da98..7025df76a 100644
--- a/man/pulse-client.conf.5.xml.in
+++ b/man/pulse-client.conf.5.xml.in
@@ -69,7 +69,7 @@ USA.
<option>
<p><opt>autospawn=</opt> Autospawn a PulseAudio daemon when
- needed. Takes a boolean value, defaults to <opt>yes</opt>.</p>
+ needed. Takes a boolean value, defaults to <opt>@PA_DEFAULT_AUTOSPAWN@</opt>.</p>
</option>
<option>
diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
index e0acc237d..80ddae02f 100644
--- a/src/pulse/client-conf.c
+++ b/src/pulse/client-conf.c
@@ -65,7 +65,11 @@ static const pa_client_conf default_conf = {
.cookie_from_x11_valid = false,
.cookie_file_from_application = NULL,
.cookie_file_from_client_conf = NULL,
+#ifdef HAVE_SYSTEMD_DAEMON
+ .autospawn = false,
+#else
.autospawn = true,
+#endif
.disable_shm = false,
.shm_size = 0,
.auto_connect_localhost = false,
diff --git a/src/pulse/client.conf.in b/src/pulse/client.conf.in
index 17753b02e..446e22a3a 100644
--- a/src/pulse/client.conf.in
+++ b/src/pulse/client.conf.in
@@ -24,7 +24,7 @@
; default-server =
; default-dbus-server =
-; autospawn = yes
+; autospawn = @PA_DEFAULT_AUTOSPAWN@
; daemon-binary = @PA_BINARY@
; extra-arguments = --log-target=syslog