From 123f5afaa25618f722470472644a240d587c8beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Tue, 16 Nov 2021 10:18:59 +0100 Subject: [PATCH] Also verify that node is a SGE submit host --- cluster/apt.apply.update.sh | 16 +++++++++++++--- cluster/apt.check.update.sh | 16 +++++++++++++--- cluster/maco.apply.update.sh | 16 +++++++++++++--- cluster/sge.enable.host.queue.sh | 16 +++++++++++++--- 4 files changed, 52 insertions(+), 12 deletions(-) diff --git a/cluster/apt.apply.update.sh b/cluster/apt.apply.update.sh index 7eb0209..b403e4b 100755 --- a/cluster/apt.apply.update.sh +++ b/cluster/apt.apply.update.sh @@ -70,11 +70,21 @@ debug_message() { # {{{ # }}} is_sge_host() { # {{{ - ## Check if SGE commands (qhost) are available - if [ "$(command -v qhost)" ]; then - return_is_sge_host="0" + ## 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 | 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 − \ diff --git a/cluster/apt.check.update.sh b/cluster/apt.check.update.sh index 5182247..426317a 100755 --- a/cluster/apt.check.update.sh +++ b/cluster/apt.check.update.sh @@ -93,11 +93,21 @@ define_vars() { # {{{ # }}} is_sge_host() { # {{{ - ## Check if SGE commands (qhost) are available - if [ "$(command -v qhost)" ]; then - return_is_sge_host="0" + ## 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 | 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 − \ diff --git a/cluster/maco.apply.update.sh b/cluster/maco.apply.update.sh index 18ced89..0ca3d54 100755 --- a/cluster/maco.apply.update.sh +++ b/cluster/maco.apply.update.sh @@ -75,11 +75,21 @@ debug_message() { # {{{ # }}} is_sge_host() { # {{{ - ## Check if SGE commands (qhost) are available - if [ "$(command -v qhost)" ]; then - return_is_sge_host="0" + ## 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 | 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 − \ diff --git a/cluster/sge.enable.host.queue.sh b/cluster/sge.enable.host.queue.sh index 9cc2b2b..ec6073b 100755 --- a/cluster/sge.enable.host.queue.sh +++ b/cluster/sge.enable.host.queue.sh @@ -149,11 +149,21 @@ ${sge_hostname} is not the current host." # }}} is_sge_host() { # {{{ - ## Check if SGE commands (qhost) are available - if [ "$(command -v qhost)" ]; then - return_is_sge_host="0" + ## 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 | 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 − \