From: Jérémie Galarneau Date: Tue, 24 Apr 2018 19:58:41 +0000 (-0400) Subject: Fix: unprivilieged sessiond agent port clashes with root sessiond X-Git-Tag: v2.11.0-rc1~265 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=2288467f63826a06d25ac361fa04ea92ec7ddfa3;hp=2288467f63826a06d25ac361fa04ea92ec7ddfa3 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 Signed-off-by: Jérémie Galarneau ---