Skip to content
Snippets Groups Projects
Commit 323f098a authored by Mark Grondona's avatar Mark Grondona
Browse files

o change default spooldir to /var/spool/slurm

 o chdir to /tmp to avoid filling spooldir with corefiles (just in case)
parent 34acd854
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@
#define MAX_THREADS 64
#define DEFAULT_SPOOLDIR "/tmp/slurmd"
#define DEFAULT_SPOOLDIR "/var/spool/slurmd"
#define DEFAULT_PIDFILE "/var/run/slurmd.pid"
typedef struct connection {
......@@ -146,13 +146,18 @@ main (int argc, char *argv[])
_read_config();
/*
* Create slurmd spool directory if necessary, and chdir() to it.
* Create slurmd spool directory if necessary.
*/
if (_set_slurmd_spooldir() < 0) {
error("Unable to initialize slurmd spooldir");
exit(1);
}
if (conf->daemonize && (chdir("/tmp") < 0)) {
error("Unable to chdir to /tmp");
exit(1);
}
if (conf->daemonize)
daemon(1,0);
/*
......@@ -741,15 +746,6 @@ _set_slurmd_spooldir(void)
return SLURM_ERROR;
}
/*
* Only chdir() to spool directory if slurmd will be
* running as a daemon
*/
if (conf->daemonize && chdir(conf->spooldir) < 0) {
error("chdir(%s): %m", conf->spooldir);
return SLURM_ERROR;
}
return SLURM_SUCCESS;
}
......
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