[CONSUMERD64_LIBDIR=''])
AC_SUBST([CONSUMERD64_LIBDIR])
+AC_ARG_WITH([sessiond-bin],
+ AS_HELP_STRING([--with-sessiond-bin],
+ [Location of the sessiond executable (including the filename)]),
+ [SESSIOND_BIN="$withval"],
+ [SESSIOND_BIN=''])
+AC_SUBST([SESSIOND_BIN])
+
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.])
+AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sessiond executable.])
# Check for pthread
AC_CHECK_LIB([pthread], [pthread_create], [],
# If we build the sessiond, print the paths it will use
AS_IF([test "x$consumerd_only" = "xno"],[
+ AS_ECHO()
+ AS_ECHO_N("The lttng command will look for the lttng-sessiond executable at: ")
+ AS_IF([test "$SESSIOND_BIN" = ""],[
+ AS_ECHO_N("`eval eval echo $bindir`")
+ AS_ECHO("/lttng-sessiond")
+ ],[
+ AS_ECHO("$SESSIOND_BIN")
+ ])
+
AS_ECHO()
AS_ECHO("The sessiond daemon will look in the following directories: ")
AS_ECHO_N("32-bit consumerd executable at: ")
static int check_sessiond(void)
{
int ret;
- char *pathname = NULL, *alloc_pathname = NULL;
+ char *pathname = NULL;
ret = lttng_session_daemon_alive();
if (ret == 0) { /* not alive */
/* 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 or access denied: %s", opt_sessiond_path);
- goto end;
- }
- pathname = opt_sessiond_path;
- } else {
- /* Try LTTNG_SESSIOND_PATH env variable */
+ pathname = opt_sessiond_path;
+
+ /* Try LTTNG_SESSIOND_PATH env variable */
+ if (pathname == NULL) {
pathname = getenv(DEFAULT_SESSIOND_PATH_ENV);
}
- /* Let's rock and roll */
+ /* Try with configured path */
if (pathname == NULL) {
- ret = asprintf(&alloc_pathname, INSTALL_BIN_PATH "/lttng-sessiond");
- if (ret < 0) {
- perror("asprintf spawn sessiond");
- goto end;
+ if (CONFIG_SESSIOND_BIN[0] != '\0') {
+ pathname = CONFIG_SESSIOND_BIN;
}
- pathname = alloc_pathname;
+ }
+
+ /* Let's rock and roll while trying the default path */
+ if (pathname == NULL) {
+ pathname = INSTALL_BIN_PATH "/lttng-sessiond";
+ }
+
+ DBG("Session daemon at: %s", pathname);
+
+ /* Check existence and permissions */
+ ret = access(pathname, F_OK | X_OK);
+ if (ret < 0) {
+ ERR("No such file or access denied: %s", pathname);
+ goto end;
}
ret = spawn_sessiond(pathname);
if (ret < 0) {
ERR("Problem occurred when starting %s", pathname);
}
-
- free(alloc_pathname);
}
end:
return ret;