From 4a08b740c96ec5b5eb11c6a5c82579c764d28dc6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sun, 12 Nov 2017 14:59:28 -0500 Subject: [PATCH] Fix: kernel consumerd sock paths need rundir substitution MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/sessiond-config.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/bin/lttng-sessiond/sessiond-config.c b/src/bin/lttng-sessiond/sessiond-config.c index 9ac5f774e..d710eb4e5 100644 --- a/src/bin/lttng-sessiond/sessiond-config.c +++ b/src/bin/lttng-sessiond/sessiond-config.c @@ -188,10 +188,6 @@ int config_set_paths_root(struct sessiond_config *config) DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH); config_string_set_static(&config->health_unix_sock_path, DEFAULT_GLOBAL_HEALTH_UNIX_SOCK); - config_string_set_static(&config->kconsumerd_err_unix_sock_path, - DEFAULT_KCONSUMERD_ERR_SOCK_PATH); - config_string_set_static(&config->kconsumerd_cmd_unix_sock_path, - DEFAULT_KCONSUMERD_CMD_SOCK_PATH); end: return ret; } @@ -340,6 +336,24 @@ int sessiond_config_init(struct sessiond_config *config) config_string_set(&config->kconsumerd_path, str); str = NULL; + ret = asprintf(&str, DEFAULT_KCONSUMERD_ERR_SOCK_PATH, + config->rundir.value); + if (ret < 0) { + ERR("Failed to set kernel consumer error socket path"); + goto end; + } + config_string_set(&config->kconsumerd_err_unix_sock_path, str); + str = NULL; + + ret = asprintf(&str, DEFAULT_KCONSUMERD_CMD_SOCK_PATH, + config->rundir.value); + if (ret < 0) { + ERR("Failed to set kernel consumer command socket path"); + goto end; + } + config_string_set(&config->kconsumerd_cmd_unix_sock_path, str); + str = NULL; + ret = asprintf(&str, "%s/%s", config->rundir.value, DEFAULT_LTTNG_SESSIOND_PIDFILE); if (ret < 0) { -- 2.34.1