diff --git a/NEWS b/NEWS index 6b4316a72d8d5c57922e45b8d96e10ff9df1099b..a8d1488e7138fa740a89a301553cabf02ce170a0 100644 --- a/NEWS +++ b/NEWS @@ -1,12 +1,15 @@ This file describes changes in recent versions of SLURM. It primarily documents those changes that are of interest to users and admins. -* Changes in SLURM 1.2.0 -======================== +* Changes in SLURM 1.2.0-pre14 +============================== -- In sched/wiki2, clear required nodes list when a job is requeued. Note that the required node list is set to every node used when a job is started via sched/wiki2. -- BLUEGENE - Added display of deallocating blocks to smap and other tools. + -- Make slurmctld's working directory be same as SlurmctldLogFile (if any), + otherwise StateSaveDir (which is likely a shared directory, possibly + making core file identification more difficult). * Changes in SLURM 1.2.0-pre13 ============================== diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c index 885b0a58eb39c72e5a5addfeac349230cdc4d024..4871eb09857f4290ab4a9c91b670494f61e60535 100644 --- a/src/slurmctld/controller.c +++ b/src/slurmctld/controller.c @@ -212,7 +212,7 @@ int main(int argc, char *argv[]) #endif /* !NDEBUG */ /* - * Create StateSaveLocation directory if necessary, and chdir() to it. + * Create StateSaveLocation directory if necessary. */ if (set_slurmctld_state_loc() < 0) fatal("Unable to initialize StateSaveLocation"); @@ -223,6 +223,24 @@ int main(int argc, char *argv[]) slurmctld_conf.slurmctld_logfile); if (error_code) error("daemon error %d", error_code); + if (slurmctld_conf.slurmctld_logfile + && (slurmctld_conf.slurmctld_logfile[0] == '/')) { + char *slash_ptr, *work_dir; + work_dir = xstrdup(slurmctld_conf.slurmctld_logfile); + slash_ptr = strrchr(work_dir, '/'); + if (slash_ptr == work_dir) + work_dir[1] = '\0'; + else + slash_ptr[0] = '\0'; + if (chdir(work_dir) < 0) + fatal("chdir(%s): %m", work_dir); + xfree(work_dir); + } else { + if (chdir(slurmctld_conf.state_save_location) < 0) { + fatal("chdir(%s): %m", + slurmctld_conf.state_save_location); + } + } } info("slurmctld version %s started", SLURM_VERSION); @@ -1198,14 +1216,5 @@ set_slurmctld_state_loc(void) (void) unlink(tmp); xfree(tmp); - /* - * Only chdir() to spool directory if slurmctld will be - * running as a daemon - */ - if (daemonize && chdir(slurmctld_conf.state_save_location) < 0) { - error("chdir(%s): %m", slurmctld_conf.state_save_location); - return SLURM_ERROR; - } - return SLURM_SUCCESS; }