diff --git a/cluster/maco.check.update.sh b/cluster/maco.check.update.sh index 66eab53..20788dc 100755 --- a/cluster/maco.check.update.sh +++ b/cluster/maco.check.update.sh @@ -133,6 +133,33 @@ Test var: ${1}." return "${return_var_empty}" +} +# }}} +is_sge_host() { # {{{ + + ## Check if SGE commands (qconf) are available + if [ "$(command -v qconf)" ]; then + debug_message "is_sge_host − \ +SGE seems present on this host." + + ### And verify if the host is fully configured as a submit host + if qconf -ss 2>/dev/null | grep --word-regexp --quiet $(hostname -f); then + debug_message "is_sge_host − \ +The host seems configured as a SGE submit host." + return_is_sge_host="0" + else + return_is_sge_host="1" + debug_message "is_sge_host − \ +This host is not yet configured as a SGE submit host." + fi + else + return_is_sge_host="1" + debug_message "is_sge_host − \ +SGE is not present on this host." + fi + + return "${return_is_sge_host}" + } # }}} is_sge_master_available() { # {{{ @@ -313,6 +340,12 @@ main() { # {{{ ### }}} ## }}} + ## If SGE is not yet available on this host {{{ + ### Exit + is_sge_host \ + || exit 0 + ## }}} + ## If MACO_FAILED_MODE wasn't defined (argument, environment variable,…) {{{ if [ -z "${MACO_FAILED_MODE}" ]; then ### Set False by default diff --git a/cluster/sge.disable.host.queue.sh b/cluster/sge.disable.host.queue.sh index 04d1cb3..81975d1 100755 --- a/cluster/sge.disable.host.queue.sh +++ b/cluster/sge.disable.host.queue.sh @@ -98,6 +98,33 @@ FORCE MODE is enable, don't manage anything related to a localhost." ## }}} } # }}} +is_sge_host() { # {{{ + + ## Check if SGE commands (qconf) are available + if [ "$(command -v qconf)" ]; then + debug_message "is_sge_host − \ +SGE seems present on this host." + + ### And verify if the host is fully configured as a submit host + if qconf -ss 2>/dev/null | grep --word-regexp --quiet $(hostname -f); then + debug_message "is_sge_host − \ +The host seems configured as a SGE submit host." + return_is_sge_host="0" + else + return_is_sge_host="1" + debug_message "is_sge_host − \ +This host is not yet configured as a SGE submit host." + fi + else + return_is_sge_host="1" + debug_message "is_sge_host − \ +SGE is not present on this host." + fi + + return "${return_is_sge_host}" + +} +# }}} is_sge_master_available() { # {{{ ## Check with Netcat if SGE master (sge_qmaster) is reachable from this host. @@ -269,6 +296,12 @@ main() { # {{{ ### }}} ## }}} + ## If SGE is not yet available on this host {{{ + ### Exit + is_sge_host \ + || exit 0 + ## }}} + ## Define all vars according the selected options define_vars