From daafbd2af078bdee9493bcb914f8d8d379d5aa40 Mon Sep 17 00:00:00 2001 From: Altan Orhon Date: Wed, 25 Oct 2023 12:52:04 -0700 Subject: [PATCH] Better checking of whether slurm is running --- hyakvnc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hyakvnc b/hyakvnc index d057c59..8277b17 100755 --- a/hyakvnc +++ b/hyakvnc @@ -368,6 +368,13 @@ function check_slurm_installed { command -v squeue >/dev/null 2>&1 || return 1 } +# check_slurm_running { +# Check if SLURM is running +# Arguments: None +function check_slurm_running { + sinfo >/dev/null 2>&1 || return 1 +} + # expand_slurm_node_range() # Expand a SLURM node range to a list of nodes # Arguments: @@ -1681,7 +1688,9 @@ function main { case "${action}" in cmd_help | cmd_install | cmd_update | cmd_config) + if check_slurm_running; then hyakvnc_config_init || log WARN "Could't initialize config automatically" # Don't exit if config can't be initialized (e.g., not running on SLURM) + fi ;; *) hyakvnc_config_init || exit 1 # Fill in default values for config variables or exit if config can't be initialized