Fix: relayd not spawned on default-url live session creation
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 24 Apr 2019 20:06:01 +0000 (16:06 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 24 Apr 2019 23:30:47 +0000 (19:30 -0400)
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 <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/create.c

index fb8b10b0412adeccac9a852836ce1f81bc5c698e..438e88f4cadfeaa18e259d86047f40b9c88db2a8 100644 (file)
@@ -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);
This page took 0.025748 seconds and 4 git commands to generate.