daemon-util's check-and-start function is only used by the watcher to
start failed services that should be running on the node. Systemd
supervises and restarts the services as needed; if a service is down, it
is so either because of an unrecoverable error, or because the
administrator manually stopped it. In any case, it should not be blindly
restarted.

Signed-off-by: Apollon Oikonomopoulos <[email protected]>
---
 daemons/daemon-util.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
index fc72ad3..631dd93 100644
--- a/daemons/daemon-util.in
+++ b/daemons/daemon-util.in
@@ -324,6 +324,11 @@ check_and_start() {
   local name="$1"
 
   if ! check $name; then
+    if use_systemctl; then
+      echo "${name} supervised by systemd but not running, will not restart."
+      return 1
+    fi
+
     start $name
   fi
 }
-- 
1.9.1

Reply via email to