Fix java client connection path when LTTNG_UST_APP_PATH is set
authorKienan Stewart <kstewart@efficios.com>
Tue, 28 Nov 2023 19:39:23 +0000 (14:39 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Feb 2024 21:20:23 +0000 (16:20 -0500)
When LTTNG_UST_CTL_PATH is set for `lttng-sessiond`, the agent port is
at `$LTTNG_UST_CTL_PATH/agent.port`, not
`$LTTNG_UST_CTL_PATH/.lttng/agent.port`.

Change-Id: I79419f36cbd802da06acd68f58e437b0d4eb3856
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/lib/lttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/client/LttngTcpSessiondClient.java

index 95376044a0116e52a6eb9f26656d391ac30e9a62..82f2c2f0b96759ba3a7115b6356cbaaacd825ab4 100644 (file)
@@ -36,6 +36,7 @@ public class LttngTcpSessiondClient implements Runnable {
        private static final String SESSION_HOST = "127.0.0.1";
        private static final String ROOT_PORT_FILE = "/var/run/lttng/agent.port";
        private static final String USER_PORT_FILE = "/.lttng/agent.port";
+       private static final String APP_PATH_PORT_FILE = "/agent.port";
        private static final Charset PORT_FILE_ENCODING = Charset.forName("UTF-8");
 
        private static final int PROTOCOL_MAJOR_VERSION = 2;
@@ -179,7 +180,7 @@ public class LttngTcpSessiondClient implements Runnable {
                String lttngUstAppPath = getUstAppPath();
 
                if (lttngUstAppPath != null) {
-                       portToUse = getPortFromFile(lttngUstAppPath + USER_PORT_FILE);
+                       portToUse = getPortFromFile(lttngUstAppPath + APP_PATH_PORT_FILE);
                } else {
                        int rootPort = getPortFromFile(ROOT_PORT_FILE);
                        int userPort = getPortFromFile(getHomePath() + USER_PORT_FILE);
This page took 0.025934 seconds and 4 git commands to generate.