From d0587181c46d56b61c63ec46e0bd2173c74c38af Mon Sep 17 00:00:00 2001 From: Xuanqi He Date: Tue, 3 Oct 2023 17:10:26 -0400 Subject: [PATCH] Add a logic in rotation script, if check_login_nodes_stopped.sh doesn't exist, jump the check --- .../default/slurm/head_node/update_munge_key.sh.erb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_munge_key.sh.erb b/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_munge_key.sh.erb index 2b5f1ca7bb..044819e526 100644 --- a/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_munge_key.sh.erb +++ b/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_munge_key.sh.erb @@ -17,9 +17,12 @@ SHARED_DIRECTORY_COMPUTE="<%= @shared_directory_compute %>" SHARED_DIRECTORY_LOGIN="<%= @shared_directory_login %>" CHECK_LOGIN_NODES_SCRIPT_PATH="<%= node['cluster']['scripts_dir'] %>/slurm/check_login_nodes_stopped.sh" -# Check if login nodes are running -if ! $CHECK_LOGIN_NODES_SCRIPT_PATH; then - exit 1 +# Check if the script exists +if [ -f "$CHECK_LOGIN_NODES_SCRIPT_PATH" ]; then + # Check if login nodes are running + if ! $CHECK_LOGIN_NODES_SCRIPT_PATH; then + exit 1 + fi fi # Check compute fleet status