From 9d31d4ab0224a2ca6197bc9978f22a178d878e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Tue, 23 Nov 2021 16:45:01 +0100 Subject: [PATCH] FORCE_MODE: Don't manage host as a localhost --- cluster/sge.disable.host.queue.sh | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/cluster/sge.disable.host.queue.sh b/cluster/sge.disable.host.queue.sh index 193e8d3..cbe1d82 100755 --- a/cluster/sge.disable.host.queue.sh +++ b/cluster/sge.disable.host.queue.sh @@ -59,25 +59,28 @@ debug_message() { # {{{ # }}} define_vars() { # {{{ - ## If sge_hostname wasn't defined + ## If sge_hostname wasn't defined {{{ if [ -z "${sge_hostname}" ]; then ## Use local host for sge_hostname sge_hostname="$(hostname -f)" fi + ## }}} - ## If sge_master_uri wasn't defined (environment variable,…) + ## If sge_master_uri wasn't defined (environment variable,…) {{{ if [ -z "${sge_master_uri}" ]; then ## Use local host for sge_master_uri sge_master_uri="physix-master.ipr.univ-rennes1.fr" fi + ## }}} - ## If sge_master_port wasn't defined (environment variable,…) + ## If sge_master_port wasn't defined (environment variable,…) {{{ if [ -z "${sge_master_port}" ]; then ## Use local host for sge_master_port sge_master_port="6444" fi + ## }}} - ## If the host to manage is the current one + ## If the given host to manage is the current one {{{ if is_current_host "${sge_hostname}" ; then debug_message "define_vars − \ ${sge_hostname} is the current host." @@ -87,8 +90,18 @@ ${sge_hostname} is the current host." ${sge_hostname} is not the current host." LOCAL_HOST="1" fi + ## }}} - ## Get all queues name + ## If FORCE_MODE was defined and enabled {{{ + if [ "${FORCE_MODE}" -eq "0" ]; then + debug_message "define_vars − \ +FORCE MODE is enable, don't manage anything related to a localhost." + ## Don't manage configuration specific to a localhost + LOCAL_HOST="1" + fi + ## }}} + + ## Get all queues name {{{ sge_queues_name="$(qhost -h "${sge_hostname:=/dev/null}" -q -xml \ | grep "queue name" \ | cut -d"'" -f2 )" @@ -96,7 +109,7 @@ ${sge_hostname} is not the current host." | grep "queue name" \ | cut -d"'" -f2 \ | tr -s '\n' ' ' )" - + ## }}} } # }}} is_sge_master_available() { # {{{