From cb622db7c9b3417423d7a330b9e99e77d44f3e3f Mon Sep 17 00:00:00 2001 From: Tim Prins Date: Tue, 24 Oct 2006 13:05:13 +0000 Subject: [PATCH] Fixes trac:352 Only close off stdout/stderr from the daemons if we are not debugging the slurm pls and --debug-daemons was not passed. This commit was SVN r12276. The following Trac tickets were found above: Ticket 352 --> https://svn.open-mpi.org/trac/ompi/ticket/352 --- orte/mca/pls/slurm/pls_slurm_module.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/orte/mca/pls/slurm/pls_slurm_module.c b/orte/mca/pls/slurm/pls_slurm_module.c index c9e9e76d1e..72bc81169b 100644 --- a/orte/mca/pls/slurm/pls_slurm_module.c +++ b/orte/mca/pls/slurm/pls_slurm_module.c @@ -503,7 +503,7 @@ static int pls_slurm_finalize(void) static int pls_slurm_start_proc(int argc, char **argv, char **env, char *prefix) { - int fd; + int fd, id, debug_daemons; char *exec_argv = opal_path_findv(argv[0], 0, env, NULL); if (NULL == exec_argv) { @@ -559,10 +559,14 @@ static int pls_slurm_start_proc(int argc, char **argv, char **env, free(newenv); } - /* When not in debug mode, tie stdout/stderr to dev null so we - don't see messages from orted */ - /* XXX: this prevents --debug-daemons from working */ - if (!mca_pls_slurm_component.debug) { + /* When not in debug mode and --debug-daemons was not passed, + * tie stdout/stderr to dev null so we don't see messages from orted */ + id = mca_base_param_find("orte", "debug", "daemons"); + if(id < 0) { + id = mca_base_param_register_int("orte", "debug", "daemons", NULL, 0); + } + mca_base_param_lookup_int(id, &debug_daemons); + if (0 == mca_pls_slurm_component.debug && 0 == debug_daemons) { fd = open("/dev/null", O_CREAT|O_WRONLY|O_TRUNC, 0666); if (fd >= 0) { if (fd != 1) {