From 973ad93ec5c6cc4c373cdae2d3ef8313d0a64cb5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 24 Apr 2019 16:06:01 -0400 Subject: [PATCH] Fix: relayd not spawned on default-url live session creation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit b178f53e9 introduced a regression that causes the lttng client to not spawn a relay daemon automatically when a live session is created using the default url parameters. This fix re-introduces an equivalent check to restore the previous behaviour. Reported-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- src/bin/lttng/commands/create.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index fb8b10b04..438e88f4c 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -260,6 +260,23 @@ struct lttng_session_descriptor *create_session_descriptor(void) } if (!descriptor) { ERR("Failed to initialize session creation command."); + } else { + /* + * Auto-launch the relay daemon when a live session + * is created using default URLs. + */ + if (!opt_url && !opt_ctrl_url && !opt_data_url && + opt_live_timer && !check_relayd()) { + int ret; + const char *pathname = opt_relayd_path ? : + INSTALL_BIN_PATH "/lttng-relayd"; + + ret = spawn_relayd(pathname, 0); + if (ret < 0) { + lttng_session_descriptor_destroy(descriptor); + descriptor = NULL; + } + } } end: free(uris); -- 2.34.1