Get SGE master from config file

This commit is contained in:
Jeremy Gardais 2021-12-09 15:33:27 +01:00
parent 8eb7a52aef
commit 1d1bf88bd6
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
6 changed files with 53 additions and 52 deletions

View File

@ -291,17 +291,11 @@ Try to clean temp files, downloaded packages,…".
# }}}
main() { # {{{
## If SGE is not yet available on this host {{{
### Exit
is_sge_host \
|| exit 0
## }}}
## Test if SGE Master is reachable {{{
### 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"
## Get SGE master from current configuration
sge_master_uri=$(grep --max-count=1 -- "" /var/lib/gridengine/default/common/act_qmaster 2>/dev/null || echo "NO MASTER")
fi
### }}}
### If sge_master_port wasn't defined (environment variable,…) {{{
@ -318,6 +312,12 @@ main() { # {{{
### }}}
## }}}
## If SGE is not yet available on this host {{{
### Exit
is_sge_host \
|| exit 0
## }}}
manage_args "${ARGS}"
## Define vars

View File

@ -227,17 +227,11 @@ SGE slots currently in use: ${RED}${sge_slots_used:=/dev/null}${COLOR_DEBUG}."
# }}}
main() { # {{{
## If SGE is not yet available on this host {{{
### Exit
is_sge_host \
|| exit 0
## }}}
## Test if SGE Master is reachable {{{
### 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"
## Get SGE master from current configuration
sge_master_uri=$(grep --max-count=1 -- "" /var/lib/gridengine/default/common/act_qmaster 2>/dev/null || echo "NO MASTER")
fi
### }}}
### If sge_master_port wasn't defined (environment variable,…) {{{
@ -254,6 +248,12 @@ main() { # {{{
### }}}
## }}}
## If SGE is not yet available on this host {{{
### Exit
is_sge_host \
|| exit 0
## }}}
## Define all vars
define_vars

View File

@ -288,17 +288,11 @@ Try to clean temp files,…"
# }}}
main() { # {{{
## If SGE is not yet available on this host {{{
### Exit
is_sge_host \
|| exit 0
## }}}
## Test if SGE Master is reachable {{{
### 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"
## Get SGE master from current configuration
sge_master_uri=$(grep --max-count=1 -- "" /var/lib/gridengine/default/common/act_qmaster 2>/dev/null || echo "NO MASTER")
fi
### }}}
### If sge_master_port wasn't defined (environment variable,…) {{{
@ -315,6 +309,12 @@ main() { # {{{
### }}}
## }}}
## If SGE is not yet available on this host {{{
### Exit
is_sge_host \
|| exit 0
## }}}
manage_args "${ARGS}"
sge_hostname="$(hostname -f)"

View File

@ -295,8 +295,8 @@ main() { # {{{
## Test if SGE Master is reachable {{{
### 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"
## Get SGE master from current configuration
sge_master_uri=$(grep --max-count=1 -- "" /var/lib/gridengine/default/common/act_qmaster 2>/dev/null || echo "NO MASTER")
fi
### }}}
### If sge_master_port wasn't defined (environment variable,…) {{{

View File

@ -66,20 +66,6 @@ define_vars() { # {{{
fi
## }}}
## 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 [ -z "${sge_master_port}" ]; then
## Use local host for sge_master_port
sge_master_port="6444"
fi
## }}}
## If the given host to manage is the current one {{{
if is_current_host "${sge_hostname}" ; then
debug_message "define_vars \
@ -262,15 +248,30 @@ Try to disable SGE queue: ${RED}${local_sge_queue_name:=/dev/null}@${local_sge_h
# }}}
main() { # {{{
## Define all vars according the selected options
define_vars
## Test if SGE Master is reachable {{{
### If sge_master_uri wasn't defined (environment variable,…) {{{
if [ -z "${sge_master_uri}" ]; then
## Get SGE master from current configuration
sge_master_uri=$(grep --max-count=1 -- "" /var/lib/gridengine/default/common/act_qmaster 2>/dev/null || echo "NO MASTER")
fi
### }}}
### 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 SGE Master is not reachable from this host {{{
### Exit
### If SGE Master is not reachable from this host {{{
#### Exit
is_sge_master_available \
|| exit 0
### }}}
## }}}
## Define all vars according the selected options
define_vars
## Simple debug message with color to valid current variables
debug_message "main Try to manage \
SGE queue(s): ${RED}${sge_queues_name_print:=/dev/null}${COLOR_DEBUG}\

View File

@ -521,17 +521,11 @@ Previously disabled by a script (or FORCE is enable), try to enable SGE queue: $
# }}}
main() { # {{{
## If SGE is not yet available on this host {{{
### Exit
is_sge_host \
|| exit 0
## }}}
## Test if SGE Master is reachable {{{
### 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"
## Get SGE master from current configuration
sge_master_uri=$(grep --max-count=1 -- "" /var/lib/gridengine/default/common/act_qmaster 2>/dev/null || echo "NO MASTER")
fi
### }}}
### If sge_master_port wasn't defined (environment variable,…) {{{
@ -548,6 +542,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