Exit if SGE is not configured on hosts
This commit is contained in:
parent
15992d9393
commit
700d6d2c5c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue