Hello!
Yet another problem was found in SLURM. The option -f does not work
for slurmd. SLURM_CONF still worked but that isn't solution for automatic
startup due to some reasons. The issue is fixed now, patch attached. Not
sure if log_init() call should be moved elsewhere too though but it works
now as intended.
Andriy.diff -udpr slurm-2.2.3.plus/src/slurmd/slurmd/req.c slurm-2.2.3.plus2/src/slurmd/slurmd/req.c
--- slurm-2.2.3.plus/src/slurmd/slurmd/req.c 2011-02-17 00:30:25.000000000 +0200
+++ slurm-2.2.3.plus2/src/slurmd/slurmd/req.c 2011-05-10 21:34:26.000000000 +0300
@@ -631,6 +631,8 @@ _forkexec_slurmstepd(slurmd_step_type_t
snprintf(slurm_stepd_path, sizeof(slurm_stepd_path),
"%s/sbin/slurmstepd", SLURM_PREFIX);
}
+ /* inform slurmstepd about our config */
+ setenv("SLURM_CONF", conf->conffile, 1);
/*
* Child forks and exits
diff -udpr slurm-2.2.3.plus/src/slurmd/slurmd/slurmd.c slurm-2.2.3.plus2/src/slurmd/slurmd/slurmd.c
--- slurm-2.2.3.plus/src/slurmd/slurmd/slurmd.c 2011-02-17 00:30:25.000000000 +0200
+++ slurm-2.2.3.plus2/src/slurmd/slurmd/slurmd.c 2011-05-10 21:20:30.000000000 +0300
@@ -201,6 +201,21 @@ main (int argc, char *argv[])
_init_conf();
conf->argv = &argv;
conf->argc = &argc;
+
+ /*
+ * Process commandline arguments first, since one option may be
+ * an alternate location for the slurm config file.
+ */
+ _process_cmdline(*conf->argc, *conf->argv);
+
+ /*
+ * Read global slurm config file, ovverride necessary values from
+ * defaults and command line.
+ *
+ */
+ _read_config();
+ /* we should load config file _before_ analyzing SlurmUser below */
+
slurmd_uid = slurm_get_slurmd_user_id();
curr_uid = getuid();
if(curr_uid != slurmd_uid) {
@@ -230,7 +245,6 @@ main (int argc, char *argv[])
if (slurm_select_init(1) != SLURM_SUCCESS )
fatal( "failed to initialize node selection plugin" );
- /* NOTE: conf->logfile always NULL at this point */
log_init(argv[0], conf->log_opts, LOG_DAEMON, conf->logfile);
xsignal(SIGTERM, &_term_handler);
@@ -1180,18 +1194,6 @@ _slurmd_init(void)
char slurm_stepd_path[MAXPATHLEN];
uint32_t cpu_cnt;
- /*
- * Process commandline arguments first, since one option may be
- * an alternate location for the slurm config file.
- */
- _process_cmdline(*conf->argc, *conf->argv);
-
- /*
- * Read global slurm config file, ovverride necessary values from
- * defaults and command line.
- *
- */
- _read_config();
cpu_cnt = MAX(conf->conf_cpus, conf->block_map_size);
if ((gres_plugin_init() != SLURM_SUCCESS) ||
(gres_plugin_node_config_load(cpu_cnt) != SLURM_SUCCESS))