+ /* Try command line option path */
+ if (opt_sessiond_path != NULL) {
+ ret = access(opt_sessiond_path, F_OK | X_OK);
+ if (ret < 0) {
+ ERR("No such file: %s", opt_sessiond_path);
+ goto end;
+ }
+ pathname = opt_sessiond_path;
+ } else {
+ /* Try LTTNG_SESSIOND_PATH env variable */
+ pathname = strdup(getenv(LTTNG_SESSIOND_PATH_ENV));
+ }
+
+ /* Let's rock and roll */
+ if (pathname == NULL) {
+ ret = asprintf(&pathname, "ltt-sessiond");
+ if (ret < 0) {
+ goto end;
+ }
+ }
+
+ ret = spawn_sessiond(pathname);
+ free(pathname);
+ if (ret < 0) {
+ ERR("Problem occurs when starting %s", pathname);
+ goto end;
+ }