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
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user