summaryrefslogtreecommitdiff
path: root/src/modules/x11
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2018-03-06 15:09:06 +0200
committerArun Raghavan <arun@arunraghavan.net>2018-06-21 06:02:21 +0530
commitde705a0eeaa27a8ac1abdc2625e639340323595a (patch)
treef2e1e565779f3d400268782bd3365e6ee3c1232c /src/modules/x11
parent83675b3745c64bd738400eae44eb4daa195ed88a (diff)
downloadpulseaudio-de705a0eeaa27a8ac1abdc2625e639340323595a.tar.gz
set exit_idle_time to 0 when we detect a session
As the comments explain, this fixes relogin problems on some systems that remove our sockets on logout without terminating the daemon.
Diffstat (limited to 'src/modules/x11')
-rw-r--r--src/modules/x11/module-x11-xsmp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/modules/x11/module-x11-xsmp.c b/src/modules/x11/module-x11-xsmp.c
index 0238e5167..6f8012372 100644
--- a/src/modules/x11/module-x11-xsmp.c
+++ b/src/modules/x11/module-x11-xsmp.c
@@ -206,6 +206,19 @@ int pa__init(pa_module*m) {
if (!u->client)
goto fail;
+ /* Positive exit_idle_time is only useful when we have no session tracking
+ * capability, so we can set it to 0 now that we have detected a session.
+ * The benefit of setting exit_idle_time to 0 is that pulseaudio will exit
+ * immediately when the session ends. That in turn is useful, because some
+ * systems (those that use pam_systemd but don't use systemd for managing
+ * pulseaudio) clean $XDG_RUNTIME_DIR on logout, but fail to terminate all
+ * services that depend on the files in $XDG_RUNTIME_DIR. The directory
+ * contains our sockets, and if the sockets are removed without terminating
+ * pulseaudio, a quick relogin will likely cause trouble, because a new
+ * instance will be spawned while the old instance is still running. */
+ if (u->core->exit_idle_time > 0)
+ pa_core_set_exit_idle_time(u->core, 0);
+
pa_modargs_free(ma);
return 0;