X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=35007b728a10eb9df8c2200167ef5885c99f95ff;hp=05646279a63a48b3f81bbf64d67454b9aaf53a1c;hb=43c5442ea57aca20701fd49fba1e3456d48cc7b2;hpb=f20baf8e44b5d8a1c90b8b029b876762f6f916a6 diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 05646279a..35007b728 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -455,6 +455,11 @@ static void cleanup(void) DBG("Removing %s", path); (void) unlink(path); + snprintf(path, PATH_MAX, "%s/%s", rundir, + DEFAULT_LTTNG_SESSIOND_JULPORT_FILE); + DBG("Removing %s", path); + (void) unlink(path); + /* kconsumerd */ snprintf(path, PATH_MAX, DEFAULT_KCONSUMERD_ERR_SOCK_PATH, @@ -494,6 +499,7 @@ static void cleanup(void) DBG("Removing directory %s", path); (void) rmdir(path); + (void) rmdir(rundir); free(rundir); DBG("Cleaning up all sessions"); @@ -1573,7 +1579,7 @@ static void *thread_dispatch_ust_registration(void *data) if (ret < 0) { PERROR("close ust sock dispatch %d", ust_cmd->sock); } - lttng_fd_put(1, LTTNG_FD_APPS); + lttng_fd_put(LTTNG_FD_APPS, 1); free(ust_cmd); goto error; } @@ -1587,7 +1593,7 @@ static void *thread_dispatch_ust_registration(void *data) if (ret < 0) { PERROR("close ust sock dispatch %d", ust_cmd->sock); } - lttng_fd_put(1, LTTNG_FD_APPS); + lttng_fd_put(LTTNG_FD_APPS, 1); free(wait_node); free(ust_cmd); continue; @@ -1635,7 +1641,7 @@ static void *thread_dispatch_ust_registration(void *data) if (ret < 0) { PERROR("close ust sock dispatch %d", ust_cmd->sock); } - lttng_fd_put(1, LTTNG_FD_APPS); + lttng_fd_put(LTTNG_FD_APPS, 1); } free(ust_cmd); } @@ -4429,6 +4435,34 @@ error: return; } +/* + * Write JUL TCP port using the rundir. + */ +static void write_julport(void) +{ + int ret; + char path[PATH_MAX]; + + assert(rundir); + + ret = snprintf(path, sizeof(path), "%s/" + DEFAULT_LTTNG_SESSIOND_JULPORT_FILE, rundir); + if (ret < 0) { + PERROR("snprintf julport path"); + goto error; + } + + /* + * Create TCP JUL port file in rundir. Return value is of no importance. + * The execution will continue even though we are not able to write the + * file. + */ + (void) utils_create_pid_file(jul_tcp_port, path); + +error: + return; +} + /* * main */ @@ -4735,6 +4769,7 @@ int main(int argc, char **argv) } write_pidfile(); + write_julport(); /* Initialize communication library */ lttcomm_init();