From 7e9f7a56f880455799f64fab76e782aeceeaf0ef Mon Sep 17 00:00:00 2001 From: max Date: Fri, 4 Sep 2026 20:54:12 +0200 Subject: [PATCH] feat(install): add Linux server systemd installation script --- compilation/install_linux_server.sh | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 compilation/install_linux_server.sh diff --git a/compilation/install_linux_server.sh b/compilation/install_linux_server.sh new file mode 100644 index 0000000..3029bff --- /dev/null +++ b/compilation/install_linux_server.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set -euo pipefail + +INSTALL_DIR="/opt/logar-server" +CONFIG_DIR="/etc/logar" + +echo "[+] Installing LOGAR Server..." +mkdir -p "${INSTALL_DIR}" "${CONFIG_DIR}" "/var/log/logar" + +if [ -f "dist/Server.bin" ]; then + cp dist/Server.bin "${INSTALL_DIR}/Server" +elif [ -f "dist/Server" ]; then + cp dist/Server "${INSTALL_DIR}/Server" +elif [ -f "dist/LOGAR_Server" ]; then + cp dist/LOGAR_Server "${INSTALL_DIR}/Server" +else + echo "[!] Warning: dist/Server.bin binary not found in current directory. Continuing with existing binary if present." +fi + +if [ -f "${INSTALL_DIR}/Server" ]; then + chmod +x "${INSTALL_DIR}/Server" +fi + +cat < /etc/systemd/system/logar-server.service +[Unit] +Description=LOGAR Hub and Aggregator Engine +After=network.target + +[Service] +Type=simple +WorkingDirectory=${INSTALL_DIR} +ExecStart=${INSTALL_DIR}/Server --config ${CONFIG_DIR}/server_config.json +Restart=always +RestartSec=5s +User=root +LimitNOFILE=65536 + +[Install] +WantedBy=multi-user.target +EOF + +if command -v systemctl >/dev/null 2>&1; then + systemctl daemon-reload + systemctl enable --now logar-server.service || true + echo "[+] LOGAR Server service installed and activated." +else + echo "[+] Systemd service installed at /etc/systemd/system/logar-server.service" +fi