From d323d859351a8984e7299233c55a142b17f9f10c Mon Sep 17 00:00:00 2001
From: David Bigagli <david@schedmd.com>
Date: Mon, 6 Jan 2014 16:24:22 -0800
Subject: [PATCH] Modify slurmstepd to log using LogTimeFormat in slurm.conf.

---
 src/slurmd/common/slurmstepd_init.c | 2 ++
 src/slurmd/slurmstepd/slurmstepd.c  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/slurmd/common/slurmstepd_init.c b/src/slurmd/common/slurmstepd_init.c
index 02e598f322d..bc7977eab06 100644
--- a/src/slurmd/common/slurmstepd_init.c
+++ b/src/slurmd/common/slurmstepd_init.c
@@ -71,6 +71,7 @@ extern void pack_slurmd_conf_lite(slurmd_conf_t *conf, Buf buffer)
 	packstr(conf->node_topo_addr, buffer);
 	packstr(conf->node_topo_pattern, buffer);
 	pack32((uint32_t)conf->port, buffer);
+	pack16(conf->log_fmt, buffer);
 }
 
 extern int unpack_slurmd_conf_lite_no_alloc(slurmd_conf_t *conf, Buf buffer)
@@ -109,6 +110,7 @@ extern int unpack_slurmd_conf_lite_no_alloc(slurmd_conf_t *conf, Buf buffer)
 	safe_unpackstr_xmalloc(&conf->node_topo_addr, &uint32_tmp, buffer);
 	safe_unpackstr_xmalloc(&conf->node_topo_pattern, &uint32_tmp, buffer);
 	safe_unpack32(&uint32_tmp, buffer);
+	safe_unpack16(&conf->log_fmt, buffer);
 	conf->port = uint32_tmp;
 	return SLURM_SUCCESS;
 
diff --git a/src/slurmd/slurmstepd/slurmstepd.c b/src/slurmd/slurmstepd/slurmstepd.c
index 5de6cb99161..6dcb4d310d5 100644
--- a/src/slurmd/slurmstepd/slurmstepd.c
+++ b/src/slurmd/slurmstepd/slurmstepd.c
@@ -404,7 +404,9 @@ _init_from_slurmd(int sock, char **argv,
 	/* receive conf from slurmd */
 	if ((conf = read_slurmd_conf_lite (sock)) == NULL)
 		fatal("Failed to read conf from slurmd");
+
 	log_alter(conf->log_opts, 0, conf->logfile);
+	log_set_timefmt(conf->log_fmt);
 
 	debug2("debug level is %d.", conf->debug_level);
 
-- 
GitLab