From 95b12a0d3938cc9d836d6b2e41ccd04e0e2bd288 Mon Sep 17 00:00:00 2001 From: minatoaquaMK2 Date: Fri, 14 Oct 2022 23:09:17 +0800 Subject: [PATCH] Agent: enhance systemd service dependency The create-cluster-and-infraenv.service "Requires" assisted-service.service, this will make it be deactived when assisted-service.service fail to start. When assisted-service.service restarts, sinece create-cluster-and-infraenv.service was deactived, it will not restart automatically. Therefore, it is better to use "Wants=", it is a weaker version of Requires, and the dependency failure will not affect the dependent. https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requires= --- .../systemd/units/create-cluster-and-infraenv.service.template | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/data/agent/systemd/units/create-cluster-and-infraenv.service.template b/data/data/agent/systemd/units/create-cluster-and-infraenv.service.template index e658938c56..3dc0fa29d1 100644 --- a/data/data/agent/systemd/units/create-cluster-and-infraenv.service.template +++ b/data/data/agent/systemd/units/create-cluster-and-infraenv.service.template @@ -1,7 +1,6 @@ [Unit] Description=Service that creates initial cluster and infraenv -Wants=network-online.target -Requires=assisted-service.service +Wants=network-online.target assisted-service.service PartOf=assisted-service-pod.service After=network-online.target assisted-service.service ConditionPathExists=/etc/assisted-service/node0