dbus-launch: if using X to define the session lifetime, do not poll stdin
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 7 Feb 2012 16:55:05 +0000 (16:55 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 15 Jun 2012 12:09:58 +0000 (13:09 +0100)
commit1785b37e430efd912ef9dda0c728984a3eba4f09
tree9952ef45d0043570c2397ced6893548a5197baf4
parentab0cebd8830f6d48e49083a06de17a6a9e5d4d98
dbus-launch: if using X to define the session lifetime, do not poll stdin

dbus-launch --exit-with-session attempts to scope the session length
to various things:

- if DISPLAY points to an X server, exit when the X session ends
- if stdin is a terminal, exit when end-of-file is reached
- if both are true, exit when one of them happens, whichever is first
- if neither is true, fail

These are not particularly useful semantics: if the session is scoped to
the X session, then the terminal from which dbus-launch was launched
is irrelevant. This also causes practical problems when dbus-launch
consumes characters from the terminal from which it happens to have
been launched (some display managers, like slim and nodm, run users' X
sessions with stdin pointing to the terminal from which the init daemon
happens to have started the display manager during boot, usually tty1
on Linux).

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39197
tools/dbus-launch.c