X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=10e5ffdbc02cbdbfa496376440a856fe664d91c7;hp=fb8b10b0412adeccac9a852836ce1f81bc5c698e;hb=7b3f7be251130172712e02262d413e90f3252978;hpb=0d516803f01920a6120fffc49206e82b2e1b1fba diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index fb8b10b04..10e5ffdbc 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); @@ -620,6 +637,7 @@ end: return ret; } +static int validate_url_option_combination(void) { int ret = 0;