From 2545e087b8684602095c573de7680853a52c8c59 Mon Sep 17 00:00:00 2001 From: Tommaso Bailetti Date: Mon, 26 Feb 2024 17:57:16 +0100 Subject: [PATCH] feat: added better ordering to systemd tasks --- imageroot/actions/configure-module/20systemd | 4 +--- imageroot/actions/create-module/10setup | 5 ++++- imageroot/actions/destroy-module/20systemd | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/imageroot/actions/configure-module/20systemd b/imageroot/actions/configure-module/20systemd index d6a2194..6759193 100755 --- a/imageroot/actions/configure-module/20systemd +++ b/imageroot/actions/configure-module/20systemd @@ -5,8 +5,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -install -m 644 "${AGENT_INSTALL_DIR}/dnsmasq.service" "/etc/systemd/system/${MODULE_ID}.service" -systemctl daemon-reload +# OPs are separated due to restart systemctl enable "${MODULE_ID}.service" -# allow the reload of configuration even if systemctl restart "${MODULE_ID}.service" diff --git a/imageroot/actions/create-module/10setup b/imageroot/actions/create-module/10setup index ded3ad7..e7880a1 100755 --- a/imageroot/actions/create-module/10setup +++ b/imageroot/actions/create-module/10setup @@ -6,4 +6,7 @@ # # Create the dnsmasq.d directory -mkdir -p "${AGENT_INSTALL_DIR}/dnsmasq.d" +mkdir -p "dnsmasq.d" +# Install systemd service +install -m 644 "${AGENT_INSTALL_DIR}/dnsmasq.service" "/etc/systemd/system/${MODULE_ID}.service" +systemctl daemon-reload diff --git a/imageroot/actions/destroy-module/20systemd b/imageroot/actions/destroy-module/20systemd index 38927b6..b78021f 100755 --- a/imageroot/actions/destroy-module/20systemd +++ b/imageroot/actions/destroy-module/20systemd @@ -6,5 +6,5 @@ # systemctl disable --now "${MODULE_ID}.service" -systemctl daemon-reload rm -f "/etc/systemd/system/${MODULE_ID}.service" +systemctl daemon-reload