[RFC] Add configure option to specify default autospawn behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2014-11-29 22:04, Felipe Sateler wrote:
> Dbus integration with systemd user sessions is not complete yet. This means
> that a socket-activated pulseaudio daemon will not be able to access the session
> bus, and thus breaking several modules.
>
> This means that distributions should not yet enable the systemd units by default
> until that problem is solved. However, this does not mean that the units cannot be
> provided for the users that choose to experiment with them.
>
> Therefore, I propose to separate the decision to support socket activation from the
> decision to default to autospawn or not, via a separate configure switch
>   --enable-autospawn-default. This way one could build socket activation, and not ship
> it by default.

One could still do that behaviour by just changing autospawn in 
/etc/pulse/client.conf, right?

It looks rather like we need to provide something that builds socket 
activation but disables it? And given the problems we have with socket 
activation (combined with session level D-Bus) maybe it makes sense to 
default to that?

>
> ---
>   configure.ac            | 10 +++++++++-
>   src/pulse/client-conf.c |  6 +++---
>   2 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index fe8423f..172115b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1229,8 +1229,16 @@ 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_ARG_ENABLE([autospawn-default],
> +    AS_HELP_STRING([--enable-autospawn-default], [Enable autospawn by default (default is to disable when socket activation is enabled)]))
> +
> +PA_DEFAULT_AUTOSPAWN="$autospawn_default"
> +
> +AS_IF([test "x$HAVE_SYSTEMD_DAEMON" = "x1" && test "x$PA_DEFAULT_AUTOSPAWN" = "x"], [ PA_DEFAULT_AUTOSPAWN=no ], [ PA_DEFAULT_AUTOSPAWN=yes ])
>   AC_SUBST(PA_DEFAULT_AUTOSPAWN)
> +AS_IF([test "x$PA_DEFAULT_AUTOSPAWN" = "xyes"],
> +    AC_DEFINE(PA_DEFAULT_AUTOSPAWN, 1, [Whether autospawn is enabled by default])
> +    )
>
>   AC_SUBST(HAVE_SYSTEMD_DAEMON)
>   AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = x1])
> diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
> index 80ddae0..250d38b 100644
> --- a/src/pulse/client-conf.c
> +++ b/src/pulse/client-conf.c
> @@ -65,10 +65,10 @@ 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
> +#ifdef PA_DEFAULT_AUTOSPAWN
>       .autospawn = true,
> +#else
> +    .autospawn = false,
>   #endif
>       .disable_shm = false,
>       .shm_size = 0,
>

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux