X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=6a2cfc988a24006b03ac3eee21747616d58e7e3a;hp=087846df1c45f086298c51baf7996fbc53583a7f;hb=68264071f9d1b789de1350cbec479b52a9b54acf;hpb=173af62f4804133d4a7f45e34b6f72126f3eca5f diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 087846df1..6a2cfc988 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2177,6 +2177,20 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) goto skip_setup; } + /* Create directories if consumer is LOCAL and has a path defined. */ + if (usess->consumer->type == CONSUMER_DST_LOCAL && + strlen(usess->consumer->dst.trace_path) > 0) { + ret = run_as_mkdir_recursive(usess->consumer->dst.trace_path, + S_IRWXU | S_IRWXG, usess->uid, usess->gid); + if (ret < 0) { + if (ret != -EEXIST) { + ERR("Trace directory creation error"); + ret = -1; + goto error_rcu_unlock; + } + } + } + /* Indicate that the session has been started once */ ua_sess->started = 1; @@ -2907,12 +2921,12 @@ int ust_app_validate_version(int sock) } /* Validate version */ - if (app->version.major > UST_APP_MAJOR_VERSION) { + if (app->version.major != UST_APP_MAJOR_VERSION) { goto error; } - DBG2("UST app PID %d is compatible with major version %d " - "(supporting <= %d)", app->pid, app->version.major, + DBG2("UST app PID %d is compatible with internal major version %d " + "(supporting == %d)", app->pid, app->version.major, UST_APP_MAJOR_VERSION); app->compatible = 1; rcu_read_unlock(); @@ -2920,8 +2934,8 @@ int ust_app_validate_version(int sock) return 0; error: - DBG2("UST app PID %d is not compatible with major version %d " - "(supporting <= %d)", app->pid, app->version.major, + DBG2("UST app PID %d is not compatible with internal major version %d " + "(supporting == %d)", app->pid, app->version.major, UST_APP_MAJOR_VERSION); app->compatible = 0; rcu_read_unlock();