Skip to content
Snippets Groups Projects
Commit f158992b authored by Danny Auble's avatar Danny Auble
Browse files

fix for logging in slurmd_step.c

parent 4f51126d
No related branches found
No related tags found
No related merge requests found
...@@ -384,19 +384,23 @@ extern void pack_slurmd_conf_lite(slurmd_conf_t *conf, Buf buffer) ...@@ -384,19 +384,23 @@ extern void pack_slurmd_conf_lite(slurmd_conf_t *conf, Buf buffer)
packstr(conf->logfile, buffer); packstr(conf->logfile, buffer);
packstr(conf->cf.job_acct_parameters, buffer); packstr(conf->cf.job_acct_parameters, buffer);
pack32(conf->debug_level, buffer); pack32(conf->debug_level, buffer);
pack32(conf->daemonize, buffer);
} }
extern int unpack_slurmd_conf_lite_no_alloc(slurmd_conf_t *conf, Buf buffer) extern int unpack_slurmd_conf_lite_no_alloc(slurmd_conf_t *conf, Buf buffer)
{ {
uint16_t uint16_tmp; uint16_t uint16_tmp;
uint32_t uint32_tmp;
safe_unpackstr_xmalloc(&conf->hostname, &uint16_tmp, buffer); safe_unpackstr_xmalloc(&conf->hostname, &uint16_tmp, buffer);
safe_unpackstr_xmalloc(&conf->spooldir, &uint16_tmp, buffer); safe_unpackstr_xmalloc(&conf->spooldir, &uint16_tmp, buffer);
safe_unpackstr_xmalloc(&conf->node_name, &uint16_tmp, buffer); safe_unpackstr_xmalloc(&conf->node_name, &uint16_tmp, buffer);
safe_unpackstr_xmalloc(&conf->logfile, &uint16_tmp, buffer); safe_unpackstr_xmalloc(&conf->logfile, &uint16_tmp, buffer);
safe_unpackstr_xmalloc(&conf->cf.job_acct_parameters, safe_unpackstr_xmalloc(&conf->cf.job_acct_parameters,
&uint16_tmp, buffer); &uint16_tmp, buffer);
safe_unpack32(&conf->debug_level, buffer); safe_unpack32(&uint32_tmp, buffer);
conf->debug_level = uint32_tmp;
safe_unpack32(&uint32_tmp, buffer);
conf->daemonize = uint32_tmp;
return SLURM_SUCCESS; return SLURM_SUCCESS;
unpack_error: unpack_error:
return SLURM_ERROR; return SLURM_ERROR;
......
...@@ -91,6 +91,20 @@ main (int argc, char *argv[]) ...@@ -91,6 +91,20 @@ main (int argc, char *argv[])
conf->log_opts.syslog_level = conf->debug_level; conf->log_opts.syslog_level = conf->debug_level;
/* forward the log options to slurmd_step */ /* forward the log options to slurmd_step */
//log_alter(conf->log_opts, 0, NULL); //log_alter(conf->log_opts, 0, NULL);
/*
* If daemonizing, turn off stderr logging -- also, if
* logging to a file, turn off syslog.
*
* Otherwise, if remaining in foreground, turn off logging
* to syslog (but keep logfile level)
*/
if (conf->daemonize) {
conf->log_opts.stderr_level = LOG_LEVEL_QUIET;
if (conf->logfile)
conf->log_opts.syslog_level = LOG_LEVEL_QUIET;
} else
conf->log_opts.syslog_level = LOG_LEVEL_QUIET;
log_init(argv[0],conf->log_opts, LOG_DAEMON, conf->logfile); log_init(argv[0],conf->log_opts, LOG_DAEMON, conf->logfile);
g_slurmd_jobacct_init(conf->cf.job_acct_parameters); g_slurmd_jobacct_init(conf->cf.job_acct_parameters);
switch_g_slurmd_step_init(); switch_g_slurmd_step_init();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment