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