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>
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;
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);