Exit if SGE isn't available on a host
This commit is contained in:
parent
cd8f4db423
commit
259fbd8531
|
@ -68,6 +68,23 @@ debug_message() { # {{{
|
|||
return 0
|
||||
}
|
||||
# }}}
|
||||
is_sge_host() { # {{{
|
||||
|
||||
## Check if SGE commands (qhost) are available
|
||||
if [ "$(command -v qhost)" ]; then
|
||||
return_is_sge_host="0"
|
||||
debug_message "is_sge_host − \
|
||||
SGE seems present on this host."
|
||||
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_apt_upgrade_absent() { # {{{
|
||||
|
||||
## Check if temp APT upgrade file is absent
|
||||
|
@ -211,7 +228,7 @@ procs running (with the pattern: ${RED}${local_proc_pattern}${COLOR_DEBUG}) on t
|
|||
|
||||
}
|
||||
# }}}
|
||||
prepare_host() { # {{{
|
||||
prepare_host() { # {{{
|
||||
|
||||
debug_message "prepare_host − \
|
||||
Forbid SSH logins,…".
|
||||
|
@ -247,6 +264,11 @@ main() { # {{{
|
|||
|
||||
manage_args "${ARGS}"
|
||||
|
||||
## If SGE is not yet available on this host
|
||||
### Exit
|
||||
is_sge_host \
|
||||
|| exit 0
|
||||
|
||||
sge_hostname="$(hostname -f)"
|
||||
sge_queues_name="$(qhost -h "${sge_hostname:=/dev/null}" -q -xml \
|
||||
| grep "queue name" \
|
||||
|
|
|
@ -84,6 +84,23 @@ define_vars() { # {{{
|
|||
| grep --max-count=1 -- "'slots_used'" \
|
||||
| sed 's;.*<queuevalue.*>\(.*\)</queuevalue>;\1;')
|
||||
|
||||
}
|
||||
# }}}
|
||||
is_sge_host() { # {{{
|
||||
|
||||
## Check if SGE commands (qhost) are available
|
||||
if [ "$(command -v qhost)" ]; then
|
||||
return_is_sge_host="0"
|
||||
debug_message "is_sge_host − \
|
||||
SGE seems present on this host."
|
||||
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_apt_upgrade_absent() { # {{{
|
||||
|
@ -156,6 +173,12 @@ main() { # {{{
|
|||
## Define all vars
|
||||
define_vars
|
||||
|
||||
## If SGE is not yet available on this host {{{
|
||||
### Exit
|
||||
is_sge_host \
|
||||
|| exit 0
|
||||
## }}}
|
||||
|
||||
## If NO APT package upgrade is available {{{
|
||||
### Ensure to remove any temp file related to APT upgrades
|
||||
### AND Exit
|
||||
|
|
|
@ -73,6 +73,23 @@ debug_message() { # {{{
|
|||
return 0
|
||||
}
|
||||
# }}}
|
||||
is_sge_host() { # {{{
|
||||
|
||||
## Check if SGE commands (qhost) are available
|
||||
if [ "$(command -v qhost)" ]; then
|
||||
return_is_sge_host="0"
|
||||
debug_message "is_sge_host − \
|
||||
SGE seems present on this host."
|
||||
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_apt_upgrade_present() { # {{{
|
||||
|
||||
## Check if temp APT upgrade file exists
|
||||
|
@ -244,6 +261,11 @@ main() { # {{{
|
|||
|
||||
manage_args "${ARGS}"
|
||||
|
||||
## If SGE is not yet available on this host
|
||||
### Exit
|
||||
is_sge_host \
|
||||
|| exit 0
|
||||
|
||||
sge_hostname="$(hostname -f)"
|
||||
sge_queues_name="$(qhost -h "${sge_hostname:=/dev/null}" -q -xml \
|
||||
| grep "queue name" \
|
||||
|
|
|
@ -147,6 +147,23 @@ ${sge_hostname} is not the current host."
|
|||
sge_queue_flag_pattern="${cluster_dir}/.sge.*.disable"
|
||||
}
|
||||
# }}}
|
||||
is_sge_host() { # {{{
|
||||
|
||||
## Check if SGE commands (qhost) are available
|
||||
if [ "$(command -v qhost)" ]; then
|
||||
return_is_sge_host="0"
|
||||
debug_message "is_sge_host − \
|
||||
SGE seems present on this host."
|
||||
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_current_host() { # {{{
|
||||
|
||||
local_current_host="${1}"
|
||||
|
@ -427,6 +444,11 @@ main() { # {{{
|
|||
## Define all vars according the selected options
|
||||
define_vars
|
||||
|
||||
## If SGE is not yet available on this host
|
||||
### Exit
|
||||
is_sge_host \
|
||||
|| exit 0
|
||||
|
||||
## If we need to watch for upgrades
|
||||
if [ "${CHECK_UPGRADE}" -eq "0" ]; then
|
||||
## If APT package upgrade is available
|
||||
|
|
Loading…
Reference in New Issue