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

Free and report AuthType and PluginDir config structure elements.

Load and dump  AuthType and PluginDir config structure elements to get config RPC.
parent b10840e2
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,7 @@ void
init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr)
{
ctl_conf_ptr->last_update = time(NULL);
xfree (ctl_conf_ptr->authtype);
xfree (ctl_conf_ptr->backup_addr);
xfree (ctl_conf_ptr->backup_controller);
xfree (ctl_conf_ptr->control_addr);
......@@ -111,6 +112,7 @@ init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr)
xfree (ctl_conf_ptr->job_credential_private_key);
xfree (ctl_conf_ptr->job_credential_public_certificate);
ctl_conf_ptr->kill_wait = (uint16_t) NO_VAL;
xfree (ctl_conf_ptr->plugindir);
xfree (ctl_conf_ptr->prioritize);
xfree (ctl_conf_ptr->prolog);
ctl_conf_ptr->ret2service = (uint16_t) NO_VAL;
......@@ -172,6 +174,7 @@ parse_config_spec (char *in_line, slurm_ctl_conf_t *ctl_conf_ptr)
struct servent *servent;
error_code = slurm_parser (in_line,
"AuthType=", 's', &authtype,
"BackupAddr=", 's', &backup_addr,
"BackupController=", 's', &backup_controller,
"ControlAddr=", 's', &control_addr,
......@@ -186,6 +189,7 @@ parse_config_spec (char *in_line, slurm_ctl_conf_t *ctl_conf_ptr)
"JobCredentialPublicCertificate=", 's',
&job_credential_public_certificate,
"KillWait=", 'd', &kill_wait,
"PluginDir=", 's', &plugindir,
"Prioritize=", 's', &prioritize,
"Prolog=", 's', &prolog,
"ReturnToService=", 'd', &ret2service,
......@@ -202,14 +206,20 @@ parse_config_spec (char *in_line, slurm_ctl_conf_t *ctl_conf_ptr)
"SlurmdSpoolDir=", 's', &slurmd_spooldir,
"SlurmdTimeout=", 'd', &slurmd_timeout,
"StateSaveLocation=", 's', &state_save_location,
"PluginDir=", 's', &plugindir,
"AuthType=", 's', &authtype,
"TmpFS=", 's', &tmp_fs,
"END");
if (error_code)
return error_code;
if ( authtype ) {
if ( ctl_conf_ptr->authtype ) {
error( MULTIPLE_VALUE_MSG, "AuthType" );
xfree( ctl_conf_ptr->authtype );
}
ctl_conf_ptr->authtype = authtype;
}
if ( backup_addr ) {
if ( ctl_conf_ptr->backup_addr ) {
error (MULTIPLE_VALUE_MSG, "BackupAddr");
......@@ -286,6 +296,14 @@ parse_config_spec (char *in_line, slurm_ctl_conf_t *ctl_conf_ptr)
ctl_conf_ptr->kill_wait = kill_wait;
}
if ( plugindir ) {
if ( ctl_conf_ptr->plugindir ) {
error( MULTIPLE_VALUE_MSG, "PluginDir" );
xfree( ctl_conf_ptr->plugindir );
}
ctl_conf_ptr->plugindir = plugindir;
}
if ( prioritize ) {
if ( ctl_conf_ptr->prioritize ) {
error (MULTIPLE_VALUE_MSG, "Prioritize");
......@@ -422,21 +440,6 @@ parse_config_spec (char *in_line, slurm_ctl_conf_t *ctl_conf_ptr)
ctl_conf_ptr->state_save_location = state_save_location;
}
if ( plugindir ) {
if ( ctl_conf_ptr->plugindir ) {
error( MULTIPLE_VALUE_MSG, "PluginDir" );
xfree( ctl_conf_ptr->plugindir );
}
ctl_conf_ptr->plugindir = plugindir;
}
if ( authtype ) {
if ( ctl_conf_ptr->authtype ) {
error( MULTIPLE_VALUE_MSG, "AuthType" );
xfree( ctl_conf_ptr->authtype );
}
ctl_conf_ptr->authtype = authtype;
}
if ( tmp_fs ) {
if ( ctl_conf_ptr->tmp_fs ) {
......
......@@ -1584,6 +1584,7 @@ static void
_pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer)
{
pack_time(build_ptr->last_update, buffer);
packstr(build_ptr->authtype, buffer);
packstr(build_ptr->backup_addr, buffer);
packstr(build_ptr->backup_controller, buffer);
packstr(build_ptr->control_addr, buffer);
......@@ -1594,6 +1595,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer)
pack16(build_ptr->heartbeat_interval, buffer);
pack16(build_ptr->inactive_limit, buffer);
pack16(build_ptr->kill_wait, buffer);
packstr(build_ptr->plugindir, buffer);
packstr(build_ptr->prioritize, buffer);
packstr(build_ptr->prolog, buffer);
pack16(build_ptr->ret2service, buffer);
......@@ -1627,6 +1629,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **
/* load the data values */
/* unpack timestamp of snapshot */
safe_unpack_time(&build_ptr->last_update, buffer);
safe_unpackstr_xmalloc(&build_ptr->authtype, &uint16_tmp, buffer);
safe_unpackstr_xmalloc(&build_ptr->backup_addr, &uint16_tmp, buffer);
safe_unpackstr_xmalloc(&build_ptr->backup_controller, &uint16_tmp,
buffer);
......@@ -1639,6 +1642,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **
safe_unpack16(&build_ptr->heartbeat_interval, buffer);
safe_unpack16(&build_ptr->inactive_limit, buffer);
safe_unpack16(&build_ptr->kill_wait, buffer);
safe_unpackstr_xmalloc(&build_ptr->plugindir, &uint16_tmp, buffer);
safe_unpackstr_xmalloc(&build_ptr->prioritize, &uint16_tmp, buffer);
safe_unpackstr_xmalloc(&build_ptr->prolog, &uint16_tmp, buffer);
safe_unpack16(&build_ptr->ret2service, buffer);
......@@ -1667,11 +1671,13 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **
return SLURM_SUCCESS;
unpack_error:
xfree(build_ptr->authtype);
xfree(build_ptr->backup_addr);
xfree(build_ptr->backup_controller);
xfree(build_ptr->control_addr);
xfree(build_ptr->control_machine);
xfree(build_ptr->epilog);
xfree(build_ptr->plugindir);
xfree(build_ptr->prioritize);
xfree(build_ptr->prolog);
xfree(build_ptr->slurmctld_logfile);
......
......@@ -2000,6 +2000,7 @@ static int _slurmctld_shutdown(void)
void _fill_ctld_conf(slurm_ctl_conf_t * conf_ptr)
{
conf_ptr->last_update = time(NULL);
conf_ptr->authtype = slurmctld_conf.authtype;
conf_ptr->backup_addr = slurmctld_conf.backup_addr;
conf_ptr->backup_controller = slurmctld_conf.backup_controller;
conf_ptr->control_addr = slurmctld_conf.control_addr;
......@@ -2015,6 +2016,7 @@ void _fill_ctld_conf(slurm_ctl_conf_t * conf_ptr)
conf_ptr->job_credential_public_certificate =
slurmctld_conf.job_credential_public_certificate;
conf_ptr->kill_wait = slurmctld_conf.kill_wait;
conf_ptr->plugindir = slurmctld_conf.plugindir;
conf_ptr->prioritize = slurmctld_conf.prioritize;
conf_ptr->prolog = slurmctld_conf.prolog;
conf_ptr->ret2service = slurmctld_conf.ret2service;
......
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