Try to start sge service if required

This commit is contained in:
Jeremy Gardais 2020-07-06 17:19:07 +02:00
parent 7229c8640e
commit ded681aeb9
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 9 additions and 1 deletions

View File

@ -134,6 +134,7 @@ ${sge_hostname} is not the current host."
## List of process pattern to monitor ## List of process pattern to monitor
maco_proc_pattern="(/opt/maco/bin/maco.autoupdate.sh)" maco_proc_pattern="(/opt/maco/bin/maco.autoupdate.sh)"
apt_proc_pattern="(aptitude.*full-upgrade|/usr/bin/dpkg.*--configure|dpkg-deb|/bin/sh /usr/lib/needrestart/dpkg-status)" apt_proc_pattern="(aptitude.*full-upgrade|/usr/bin/dpkg.*--configure|dpkg-deb|/bin/sh /usr/lib/needrestart/dpkg-status)"
sge_proc_pattern="(/usr/lib/gridengine/sge_execd)"
## List of files to monitor ## List of files to monitor
file_nologin_path="/etc/nologin" file_nologin_path="/etc/nologin"
@ -428,6 +429,13 @@ main() { # {{{
### Exit ### Exit
is_proc_running "${maco_proc_pattern}" \ is_proc_running "${maco_proc_pattern}" \
&& exit 0 && exit 0
## If nothing related to SGE is currently running
### Try to start the SGE execd systemd service
### Exit with error if the service can't start
is_proc_running "${sge_proc_pattern}" \
&& systemctl --quiet start sge_execd.service > /dev/null 2>&1 \
|| exit 4
fi fi
## Simple debug message with color to valid current variables ## Simple debug message with color to valid current variables
@ -460,7 +468,7 @@ for host: ${RED}${sge_hostname:=/dev/null}${COLOR_DEBUG}."
### Exit with error ### Exit with error
is_queue_disable "${sge_hostname}" "${loop_queue}" \ is_queue_disable "${sge_hostname}" "${loop_queue}" \
&& printf '%b\n' "${RED}ERROR ${loop_queue}@${sge_hostname} is still disable.${RESET}" \ && printf '%b\n' "${RED}ERROR ${loop_queue}@${sge_hostname} is still disable.${RESET}" \
&& exit 4 && exit 5
fi fi
done done