From 5040ac2f16d1459fa646c46381021ba2ff2ed7eb Mon Sep 17 00:00:00 2001 From: nessi Date: Thu, 9 Jul 2026 14:58:22 +0200 Subject: [PATCH] feat: change agent installer to use restart instead of enable --now for systemd service activation Replace `systemctl enable --now` with separate `systemctl enable` and `systemctl restart` commands to ensure agent service restarts on reinstall rather than silently failing when service already exists --- backend/app/api/v1/router.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/app/api/v1/router.py b/backend/app/api/v1/router.py index 1d4c8d2..538ddc7 100644 --- a/backend/app/api/v1/router.py +++ b/backend/app/api/v1/router.py @@ -730,7 +730,8 @@ EOF if command -v systemctl >/dev/null 2>&1; then systemctl daemon-reload - systemctl enable --now "$SERVICE_NAME.service" + systemctl enable "$SERVICE_NAME.service" + systemctl restart "$SERVICE_NAME.service" systemctl status "$SERVICE_NAME.service" --no-pager || true else echo "systemctl not found. Run manually: python3 $INSTALL_DIR/nexafabric-agent.py --config $CONFIG_DIR/config.json"