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}"