Fix: unprivilieged sessiond agent port clashes with root sessiond
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 24 Apr 2018 19:58:41 +0000 (15:58 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 25 Apr 2018 15:29:40 +0000 (11:29 -0400)
commite6c533d671c9bcde5d914a18a632b6d0782c4e1a
tree931ca8b0c9123ddb43e062b43ea79cc917cf8b9b
parent9b322352451e6bda9c3dc963df08d2a4d690f7b5
Fix: unprivilieged sessiond agent port clashes with root sessiond

This fix addresses the same problem as reported in f28f9e44.

The session daemon now tries to bind the agent TCP socket to a
port within a range (10 ports by default). The session daemon
will use the first available TCP port within that range when
binding to "localhost". It is still possible to restrict the
session daemon to the broken behaviour by specifying an agent
port using the --agent-tcp-port PORT. If that option is used,
the session daemon will attempt to bind to that part. If it
fails, agent tracing will be marked as disabled.

This fix is backported since the current logic of binding to a
set port means that the default configuration on Ubuntu, Debian,
and other distributions that launch an lttng-sessiond on boot does
not allow the tracing of agent domains (Java Util Logging, log4j,
and Python logging back-ends).

By default, users are not part of the tracing group and it is
not reasonable to expect users to be part of that group for
userspace tracing.

The behaviour of the "system" lttng-sessiond does not change
as it will bind on the first available port within the range.
The non-privilieged session daemons that will be launched after
will be able to bind on other ports available within the range.

Reported-by: Deborah Barnard <starfallprojects@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
14 files changed:
configure.ac
doc/man/asciidoc-attrs.conf.in
doc/man/lttng-sessiond.8.txt
src/bin/lttng-relayd/live.c
src/bin/lttng-relayd/main.c
src/bin/lttng-sessiond/agent-thread.c
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/sessiond-config.c
src/bin/lttng-sessiond/sessiond-config.h
src/common/defaults.h
src/common/sessiond-comm/inet.c
src/common/sessiond-comm/inet6.c
src/common/sessiond-comm/sessiond-comm.c
src/common/sessiond-comm/sessiond-comm.h
This page took 0.028781 seconds and 5 git commands to generate.