Skip to content
Snippets Groups Projects
Commit 43eca6dd authored by Moe Jette's avatar Moe Jette
Browse files

Make SlurmdSpoolDir as needed rather than just aborting.

parent 1b57c956
No related branches found
No related tags found
No related merge requests found
...@@ -104,7 +104,7 @@ static void _print_conf(); ...@@ -104,7 +104,7 @@ static void _print_conf();
static void _read_config(); static void _read_config();
static void _kill_old_slurmd(); static void _kill_old_slurmd();
static void _reconfigure(); static void _reconfigure();
static void _restore_cred_state(slurm_cred_ctx_t ctx); static int _restore_cred_state(slurm_cred_ctx_t ctx);
static void _increment_thd_count(); static void _increment_thd_count();
static void _decrement_thd_count(); static void _decrement_thd_count();
static void _wait_for_all_threads(); static void _wait_for_all_threads();
...@@ -593,7 +593,8 @@ _slurmd_init() ...@@ -593,7 +593,8 @@ _slurmd_init()
/* /*
* Restore any saved revoked credential information * Restore any saved revoked credential information
*/ */
_restore_cred_state(conf->vctx); if (_restore_cred_state(conf->vctx))
return SLURM_FAILURE;
/* /*
* Cleanup shared memory if so configured * Cleanup shared memory if so configured
...@@ -624,14 +625,20 @@ _slurmd_init() ...@@ -624,14 +625,20 @@ _slurmd_init()
return SLURM_SUCCESS; return SLURM_SUCCESS;
} }
static void static int
_restore_cred_state(slurm_cred_ctx_t ctx) _restore_cred_state(slurm_cred_ctx_t ctx)
{ {
char *file_name, *data = NULL; char *file_name = NULL, *data = NULL;
uint32_t data_size = 0; uint32_t data_size = 0;
int cred_fd, data_allocated, data_read = 0; int cred_fd, data_allocated, data_read = 0;
Buf buffer = NULL; Buf buffer = NULL;
if ((mkdir(conf->spooldir, 0755) < 0) &&
(errno != EEXIST)) {
error("mkdir(%s): %m", conf->spooldir);
return SLURM_ERROR;
}
file_name = xstrdup(conf->spooldir); file_name = xstrdup(conf->spooldir);
xstrcat(file_name, "/cred_state"); xstrcat(file_name, "/cred_state");
cred_fd = open(file_name, O_RDONLY); cred_fd = open(file_name, O_RDONLY);
...@@ -655,6 +662,7 @@ _restore_cred_state(slurm_cred_ctx_t ctx) ...@@ -655,6 +662,7 @@ _restore_cred_state(slurm_cred_ctx_t ctx)
xfree(file_name); xfree(file_name);
if (buffer) if (buffer)
free_buf(buffer); free_buf(buffer);
return SLURM_SUCCESS;
} }
static int static int
......
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