X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=438e88f4cadfeaa18e259d86047f40b9c88db2a8;hb=659d0f1d6df4a7598da90f0a7f2c2d26a4548ef6;hp=a7d2d89bece3a4bdefa83f8712dd329a6afb39b0;hpb=5feee5031b7ff06f27bc5574cf4871c1b7282ab3;p=lttng-tools.git diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index a7d2d89be..438e88f4c 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -236,7 +236,6 @@ struct lttng_session_descriptor *create_session_descriptor(void) descriptor = lttng_session_descriptor_live_network_create( opt_session_name, uri_str1, uri_str2, opt_live_timer); - } else { /* Regular session. */ switch (output_type) { @@ -261,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);