- sys_port = _get_port_from_file('/var/run/lttng/agent.port')
- user_port_file = os.path.join(_get_user_home_path(), '.lttng', 'agent.port')
- user_port = _get_port_from_file(user_port_file)
+
+ # The LTTNG_UST_APP_PATH environment variables disables connections
+ # to the global and per-user session daemons.
+ if _get_ust_app_path() is not None:
+ ust_app_port_file = os.path.join(_get_ust_app_path(), 'agent.port')
+ ust_app_port = _get_port_from_file(ust_app_port_file)
+ sys_port = None
+ user_port = None
+ dbg._pdebug('ust_app session daemon port: {}'.format(ust_app_port))
+ else:
+ sys_port = _get_port_from_file('/var/run/lttng/agent.port')
+ user_port_file = os.path.join(_get_user_home_path(), '.lttng', 'agent.port')
+ user_port = _get_port_from_file(user_port_file)
+ dbg._pdebug('system session daemon port: {}'.format(sys_port))
+ dbg._pdebug('user session daemon port: {}'.format(user_port))
+