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

rearrange some code for clean AIX build and load

parent 684146c6
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "src/common/xmalloc.h" #include "src/common/xmalloc.h"
#include "src/common/slurm_protocol_api.h" #include "src/common/slurm_protocol_api.h"
#include "src/common/jobacct_common.h" #include "src/common/jobacct_common.h"
#include "src/slurmctld/slurmctld.h"
#include "src/slurmdbd/read_config.h" #include "src/slurmdbd/read_config.h"
/* Map field names to positions */ /* Map field names to positions */
...@@ -1405,8 +1406,8 @@ extern void filetxt_jobacct_process_archive(List selected_parts, ...@@ -1405,8 +1406,8 @@ extern void filetxt_jobacct_process_archive(List selected_parts,
} }
fflush(new_logfile); /* Flush the buffers before forking */ fflush(new_logfile); /* Flush the buffers before forking */
fflush(fd); fflush(fd);
file_err = slurm_reconfigure (); file_err = reconfigure_slurmctld();
if (file_err) { if (file_err) {
file_err = 1; file_err = 1;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Copyright (C) 2008 Lawrence Livermore National Security. * Copyright (C) 2008 Lawrence Livermore National Security.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Morris Jette <jette1@llnl.gov>, Kevin Tew <tew1@llnl.gov> * Written by Morris Jette <jette1@llnl.gov>, Kevin Tew <tew1@llnl.gov>
* UCRL-CODE-226842. * LLNL-CODE-402394.
* *
* This file is part of SLURM, a resource management program. * This file is part of SLURM, a resource management program.
* For details, see <http://www.llnl.gov/linux/slurm/>. * For details, see <http://www.llnl.gov/linux/slurm/>.
...@@ -552,6 +552,34 @@ static void _init_config(void) ...@@ -552,6 +552,34 @@ static void _init_config(void)
#endif #endif
} }
/* Read configuration file */
extern int reconfigure_slurmctld(void)
{
/* Locks: Write configuration, job, node, and partition */
slurmctld_lock_t config_write_lock = {
WRITE_LOCK, WRITE_LOCK, WRITE_LOCK, WRITE_LOCK };
int rc;
/*
* XXX - need to shut down the scheduler
* plugin, re-read the configuration, and then
* restart the (possibly new) plugin.
*/
lock_slurmctld(config_write_lock);
rc = read_slurm_conf(0);
if (rc)
error("read_slurm_conf: %s", slurm_strerror(rc));
else {
_update_cred_key();
set_slurmctld_state_loc();
}
unlock_slurmctld(config_write_lock);
trigger_reconfig();
slurm_sched_partition_change(); /* notify sched plugin */
select_g_reconfigure(); /* notify select plugin too */
return rc;
}
/* _slurmctld_signal_hand - Process daemon-wide signals */ /* _slurmctld_signal_hand - Process daemon-wide signals */
static void *_slurmctld_signal_hand(void *no_data) static void *_slurmctld_signal_hand(void *no_data)
{ {
...@@ -562,9 +590,6 @@ static void *_slurmctld_signal_hand(void *no_data) ...@@ -562,9 +590,6 @@ static void *_slurmctld_signal_hand(void *no_data)
/* Locks: Read configuration */ /* Locks: Read configuration */
slurmctld_lock_t config_read_lock = { slurmctld_lock_t config_read_lock = {
READ_LOCK, NO_LOCK, NO_LOCK, NO_LOCK }; READ_LOCK, NO_LOCK, NO_LOCK, NO_LOCK };
/* Locks: Write configuration, job, node, and partition */
slurmctld_lock_t config_write_lock = {
WRITE_LOCK, WRITE_LOCK, WRITE_LOCK, WRITE_LOCK };
(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); (void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
(void) pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); (void) pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
...@@ -598,24 +623,6 @@ static void *_slurmctld_signal_hand(void *no_data) ...@@ -598,24 +623,6 @@ static void *_slurmctld_signal_hand(void *no_data)
break; break;
case SIGHUP: /* kill -1 */ case SIGHUP: /* kill -1 */
info("Reconfigure signal (SIGHUP) received"); info("Reconfigure signal (SIGHUP) received");
/*
* XXX - need to shut down the scheduler
* plugin, re-read the configuration, and then
* restart the (possibly new) plugin.
*/
lock_slurmctld(config_write_lock);
rc = read_slurm_conf(0);
if (rc)
error("read_slurm_conf: %s",
slurm_strerror(rc));
else {
_update_cred_key();
set_slurmctld_state_loc();
}
unlock_slurmctld(config_write_lock);
trigger_reconfig();
slurm_sched_partition_change(); /* notify sched plugin */
select_g_reconfigure(); /* notify select plugin too */
break; break;
case SIGABRT: /* abort */ case SIGABRT: /* abort */
info("SIGABRT received"); info("SIGABRT received");
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Copyright (C) 2008 Lawrence Livermore National Security. * Copyright (C) 2008 Lawrence Livermore National Security.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Morris Jette <jette1@llnl.gov> et. al. * Written by Morris Jette <jette1@llnl.gov> et. al.
* UCRL-CODE-226842. * LLNL-CODE-402394.
* *
* This file is part of SLURM, a resource management program. * This file is part of SLURM, a resource management program.
* For details, see <http://www.llnl.gov/linux/slurm/>. * For details, see <http://www.llnl.gov/linux/slurm/>.
...@@ -1210,6 +1210,9 @@ void part_fini (void); ...@@ -1210,6 +1210,9 @@ void part_fini (void);
*/ */
extern void purge_old_job (void); extern void purge_old_job (void);
/* Read configuration file */
extern int reconfigure_slurmctld(void);
/* /*
* rehash_jobs - Create or rebuild the job hash table. * rehash_jobs - Create or rebuild the job hash table.
* NOTE: run lock_slurmctld before entry: Read config, write job * NOTE: run lock_slurmctld before entry: Read config, write job
......
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