From 3d01cb8487e90721177bfbd8e737411532b0672f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 22 Jun 2020 13:25:34 +0200 Subject: [PATCH] (re)enable SGE queue only if disable by a script Test if /etc/.sge.${QUEUE_NAME}.disable exist --- cluster/sge.enable.host.queue.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cluster/sge.enable.host.queue.sh b/cluster/sge.enable.host.queue.sh index 1d16aca..d27bfca 100755 --- a/cluster/sge.enable.host.queue.sh +++ b/cluster/sge.enable.host.queue.sh @@ -218,13 +218,19 @@ enable_sge_queue() { # {{{ local_sge_hostname="${1}" local_sge_queue_name="${2}" - ## Simple debug message to valid current variables - debug_message "enable_sge_queue − \ -Try to enable SGE queue: ${RED}${local_sge_queue_name:=/dev/null}@${local_sge_hostname:=/dev/null}${COLOR_DEBUG}." + local_sge_disable="/etc/.sge.${local_sge_queue_name}.disable" - ## SGE command to enable the queue - qmod --enable "${local_sge_queue_name}@${local_sge_hostname}" \ - && return_enable_queue="${?}" + ## If the queue was previously disabled by another script + if [ -f "${local_sge_disable}" ]; then + debug_message "enable_sge_queue − \ +Try to enable SGE queue: ${RED}${local_sge_queue_name:=/dev/null}@${local_sge_hostname:=/dev/null}${COLOR_DEBUG}." + ## SGE command to enable the queue + qmod --enable "${local_sge_queue_name}@${local_sge_hostname}" \ + && return_enable_queue="${?}" + else + debug_message "SGE queue: ${RED}${local_sge_queue_name:=/dev/null}@${local_sge_hostname:=/dev/null}${RESET} was manually disabled, please re-enable it ${RED}manually${RESET}." + return_enable_queue="1" + fi return "${return_enable_queue}"