Skip to content
Snippets Groups Projects
Commit 5ee833e2 authored by jce's avatar jce
Browse files

Fixed bug with commandline parsing of for control_machine backup_machine

parent 21c38600
No related branches found
No related tags found
No related merge requests found
...@@ -680,9 +680,7 @@ fill_ctld_conf ( slurm_ctl_conf_t * conf_ptr ) ...@@ -680,9 +680,7 @@ fill_ctld_conf ( slurm_ctl_conf_t * conf_ptr )
conf_ptr->last_update = init_time ; conf_ptr->last_update = init_time ;
if ( !conf_ptr->backup_interval ) conf_ptr->backup_interval = BACKUP_INTERVAL ; if ( !conf_ptr->backup_interval ) conf_ptr->backup_interval = BACKUP_INTERVAL ;
if ( !conf_ptr->backup_location ) conf_ptr->backup_location = BACKUP_LOCATION ; if ( !conf_ptr->backup_location ) conf_ptr->backup_location = BACKUP_LOCATION ;
if ( !conf_ptr->backup_machine ) conf_ptr->backup_machine = backup_controller ;
if ( !conf_ptr->control_daemon ) conf_ptr->control_daemon = CONTROL_DAEMON ; if ( !conf_ptr->control_daemon ) conf_ptr->control_daemon = CONTROL_DAEMON ;
if ( !conf_ptr->control_machine ) conf_ptr->control_machine = control_machine ;
if ( !conf_ptr->controller_timeout ) conf_ptr->controller_timeout = CONTROLLER_TIMEOUT ; if ( !conf_ptr->controller_timeout ) conf_ptr->controller_timeout = CONTROLLER_TIMEOUT ;
if ( !conf_ptr->epilog ) conf_ptr->epilog = EPILOG ; if ( !conf_ptr->epilog ) conf_ptr->epilog = EPILOG ;
if ( !conf_ptr->fast_schedule ) conf_ptr->fast_schedule = FAST_SCHEDULE ; if ( !conf_ptr->fast_schedule ) conf_ptr->fast_schedule = FAST_SCHEDULE ;
......
...@@ -28,10 +28,14 @@ ...@@ -28,10 +28,14 @@
int parse_node_spec (char *in_line); int parse_node_spec (char *in_line);
int parse_part_spec (char *in_line); int parse_part_spec (char *in_line);
char *backup_controller = NULL;
char *control_machine = NULL;
int node_record_count = 0; int node_record_count = 0;
#if DEBUG_MODULE
slurm_ctl_conf_t slurmctld_conf;
#else
extern slurm_ctl_conf_t slurmctld_conf;
#endif
#if DEBUG_MODULE #if DEBUG_MODULE
/* main is used here for module testing purposes only */ /* main is used here for module testing purposes only */
#include <sys/resource.h> #include <sys/resource.h>
...@@ -67,8 +71,8 @@ main (int argc, char *argv[]) { ...@@ -67,8 +71,8 @@ main (int argc, char *argv[]) {
exit (error_code); exit (error_code);
} }
printf ("ControlMachine=%s\n", control_machine); printf ("ControlMachine=%s\n", slurmctld_conf.control_machine);
printf ("BackupController=%s\n", backup_controller); printf ("BackupController=%s\n", bslurmctld_conf.backup_controller);
printf ("\n"); printf ("\n");
for (i = 0; i < node_record_count; i++) { for (i = 0; i < node_record_count; i++) {
...@@ -328,15 +332,6 @@ int ...@@ -328,15 +332,6 @@ int
init_slurm_conf () { init_slurm_conf () {
int error_code; int error_code;
if (control_machine) {
xfree (control_machine);
control_machine = NULL;
}
if (backup_controller) {
xfree (backup_controller);
backup_controller = NULL;
}
if ((error_code = init_node_conf ())) if ((error_code = init_node_conf ()))
return error_code; return error_code;
...@@ -707,6 +702,9 @@ read_slurm_conf (char *file_name) { ...@@ -707,6 +702,9 @@ read_slurm_conf (char *file_name) {
/* process the data file */ /* process the data file */
line_num = 0; line_num = 0;
while (fgets (in_line, BUF_SIZE, slurm_spec_file) != NULL) { while (fgets (in_line, BUF_SIZE, slurm_spec_file) != NULL) {
char* control_machine = NULL;
char* backup_machine = NULL;
line_num++; line_num++;
if (strlen (in_line) >= (BUF_SIZE - 1)) { if (strlen (in_line) >= (BUF_SIZE - 1)) {
error ("read_slurm_conf line %d, of input file %s too long\n", error ("read_slurm_conf line %d, of input file %s too long\n",
...@@ -737,13 +735,20 @@ read_slurm_conf (char *file_name) { ...@@ -737,13 +735,20 @@ read_slurm_conf (char *file_name) {
/* overall slurm configuration parameters */ /* overall slurm configuration parameters */
error_code = slurm_parser(in_line, error_code = slurm_parser(in_line,
"ControlMachine=", 's', &control_machine, "ControlMachine=", 's', &control_machine,
"BackupController=", 's', &backup_controller, "BackupController=", 's', &backup_machine,
"END"); "END");
if (error_code) { if (error_code) {
fclose (slurm_spec_file); fclose (slurm_spec_file);
return error_code; return error_code;
} }
if ( slurmctld_conf.control_machine == NULL ) {
slurmctld_conf.control_machine = control_machine;
}
if ( slurmctld_conf.backup_machine == NULL ) {
slurmctld_conf.backup_machine = backup_machine;
}
/* node configuration parameters */ /* node configuration parameters */
if ((error_code = parse_node_spec (in_line))) { if ((error_code = parse_node_spec (in_line))) {
fclose (slurm_spec_file); fclose (slurm_spec_file);
...@@ -762,10 +767,10 @@ read_slurm_conf (char *file_name) { ...@@ -762,10 +767,10 @@ read_slurm_conf (char *file_name) {
fclose (slurm_spec_file); fclose (slurm_spec_file);
/* if values not set in configuration file, set defaults */ /* if values not set in configuration file, set defaults */
if (backup_controller == NULL) if (slurmctld_conf.backup_machine == NULL)
info ("read_slurm_conf: backup_controller value not specified."); info ("read_slurm_conf: backup_controller value not specified.");
if (control_machine == NULL) { if (slurmctld_conf.control_machine == NULL) {
error ("read_slurm_conf: control_machine value not specified."); error ("read_slurm_conf: control_machine value not specified.");
return EINVAL; return EINVAL;
} }
......
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