From db0b6fcde9d3fa4587192d53e8dd0d8205ab862d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 30 Nov 2020 16:17:19 +0100 Subject: [PATCH] Deal with non requested reboot (restart SGE earlier) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check running processes earlier to restart SGE even after a non requested reboot (power outage, system crash,…). --- cluster/sge.enable.host.queue.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cluster/sge.enable.host.queue.sh b/cluster/sge.enable.host.queue.sh index 3ea951a..5aeb598 100755 --- a/cluster/sge.enable.host.queue.sh +++ b/cluster/sge.enable.host.queue.sh @@ -406,19 +406,6 @@ main() { # {{{ && exit 0 fi - ## If we need to watch files - if [ "${CHECK_FILE}" -eq "0" ]; then - ## If nologin file exist (error on upgrade,…) - ### Exit - is_file_present "${file_nologin_path}" \ - && exit 0 - - ## If all SGE queue(s) were manually disabled (not any flag file) - ### Exit - is_file_absent "${sge_queue_flag_pattern}" \ - && exit 0 - fi - ## If we need to watch for processes if [ "${CHECK_PROCESS}" -eq "0" ]; then ## If anything related to APT is currently running @@ -439,6 +426,19 @@ main() { # {{{ || exit 4 fi + ## If we need to watch files + if [ "${CHECK_FILE}" -eq "0" ]; then + ## If nologin file exist (error on upgrade,…) + ### Exit + is_file_present "${file_nologin_path}" \ + && exit 0 + + ## If all SGE queue(s) were manually disabled (not any flag file) + ### Exit + is_file_absent "${sge_queue_flag_pattern}" \ + && exit 0 + fi + ## 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}\