Check APT upgrade if SGE queue is already disable
This commit is contained in:
parent
ecea1311cc
commit
903143a00e
|
@ -64,29 +64,33 @@ debug_message() { # {{{
|
|||
# }}}
|
||||
define_vars() { # {{{
|
||||
|
||||
## If sge_hostname wasn't defined (environment variable,…)
|
||||
## If sge_hostname wasn't defined (environment variable,…) {{{
|
||||
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 EMPTY_ONLY_MODE wasn't defined (argument, environment variable,…)
|
||||
## If EMPTY_ONLY_MODE wasn't defined (argument, environment variable,…) {{{
|
||||
if [ -z "${EMPTY_ONLY_MODE}" ]; then
|
||||
### Set False by default
|
||||
EMPTY_ONLY_MODE="1"
|
||||
fi
|
||||
## }}}
|
||||
|
||||
## Script used to disable SGE queue(s)
|
||||
sge_disable_host_queue_script="${PROGDIR}/sge.disable.host.queue.sh"
|
||||
|
@ -96,6 +100,9 @@ define_vars() { # {{{
|
|||
| grep --max-count=1 -- "'slots_used'" \
|
||||
| sed 's;.*<queuevalue.*>\(.*\)</queuevalue>;\1;')
|
||||
|
||||
## SGE queues state file
|
||||
cluster_dir="/opt/ipr/cluster"
|
||||
sge_queue_flag_pattern="${cluster_dir}/.sge.*.disable"
|
||||
}
|
||||
# }}}
|
||||
is_sge_host() { # {{{
|
||||
|
@ -253,6 +260,16 @@ main() { # {{{
|
|||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## If SGE flag files already exists {{{
|
||||
### Check if APT package upgrade is available
|
||||
### Create APT temp file
|
||||
### AND Exit
|
||||
is_file_present "${sge_queue_flag_pattern}" \
|
||||
&& is_apt_upgrade_present \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## If EMPTY_ONLY_MODE is set {{{
|
||||
### Verify empty slots
|
||||
### OR Exit
|
||||
|
@ -265,7 +282,7 @@ main() { # {{{
|
|||
## }}}
|
||||
|
||||
## If APT package upgrade is available {{{
|
||||
### Create a temp file
|
||||
### Create APT temp file
|
||||
### Disable SGE queue
|
||||
### AND Exit
|
||||
is_apt_upgrade_present \
|
||||
|
|
Loading…
Reference in New Issue