From ded681aeb900afbdd99ae0122342361b14a0a347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 6 Jul 2020 17:19:07 +0200 Subject: [PATCH] Try to start sge service if required --- cluster/sge.enable.host.queue.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cluster/sge.enable.host.queue.sh b/cluster/sge.enable.host.queue.sh index 83b6198..2b1c943 100755 --- a/cluster/sge.enable.host.queue.sh +++ b/cluster/sge.enable.host.queue.sh @@ -134,6 +134,7 @@ ${sge_hostname} is not the current host." ## List of process pattern to monitor 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)" + sge_proc_pattern="(/usr/lib/gridengine/sge_execd)" ## List of files to monitor file_nologin_path="/etc/nologin" @@ -428,6 +429,13 @@ main() { # {{{ ### Exit is_proc_running "${maco_proc_pattern}" \ && 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 ## 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 is_queue_disable "${sge_hostname}" "${loop_queue}" \ && printf '%b\n' "${RED}ERROR ${loop_queue}@${sge_hostname} is still disable.${RESET}" \ - && exit 4 + && exit 5 fi done