diff --git a/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.c b/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.c index af014776d7af636834f9a70599215b8318361e3c..154b39b67d7b340bf6e0a60933dd8f4888075480 100644 --- a/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.c +++ b/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.c @@ -47,6 +47,7 @@ #include "src/common/xmalloc.h" #include "src/common/slurm_protocol_api.h" #include "src/common/jobacct_common.h" +#include "src/slurmctld/slurmctld.h" #include "src/slurmdbd/read_config.h" /* Map field names to positions */ @@ -1405,8 +1406,8 @@ extern void filetxt_jobacct_process_archive(List selected_parts, } fflush(new_logfile); /* Flush the buffers before forking */ fflush(fd); - - file_err = slurm_reconfigure (); + + file_err = reconfigure_slurmctld(); if (file_err) { file_err = 1; diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c index 82a36c6fe9df865fd5e2bc8f63b024068347492a..b54dde06f7fb15715ed1f8bb3f257f27a43850b3 100644 --- a/src/slurmctld/controller.c +++ b/src/slurmctld/controller.c @@ -5,7 +5,7 @@ * Copyright (C) 2008 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * 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. * For details, see <http://www.llnl.gov/linux/slurm/>. @@ -552,6 +552,34 @@ static void _init_config(void) #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 */ static void *_slurmctld_signal_hand(void *no_data) { @@ -562,9 +590,6 @@ static void *_slurmctld_signal_hand(void *no_data) /* Locks: Read configuration */ slurmctld_lock_t config_read_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_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); @@ -598,24 +623,6 @@ static void *_slurmctld_signal_hand(void *no_data) break; case SIGHUP: /* kill -1 */ 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; case SIGABRT: /* abort */ info("SIGABRT received"); diff --git a/src/slurmctld/slurmctld.h b/src/slurmctld/slurmctld.h index 4fb0d3794d362b245f0117977f21b8131e1ce441..5f25719fe3bb91b138c22eba43318d659def6ae8 100644 --- a/src/slurmctld/slurmctld.h +++ b/src/slurmctld/slurmctld.h @@ -5,7 +5,7 @@ * Copyright (C) 2008 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * 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. * For details, see <http://www.llnl.gov/linux/slurm/>. @@ -1210,6 +1210,9 @@ void part_fini (void); */ extern void purge_old_job (void); +/* Read configuration file */ +extern int reconfigure_slurmctld(void); + /* * rehash_jobs - Create or rebuild the job hash table. * NOTE: run lock_slurmctld before entry: Read config, write job