Files
aitbc/dev/ops/install_miner_systemd.sh
oib 50954a4b31 chore(systemd): remove obsolete systemd service files and update infrastructure documentation
- Remove 8 unused systemd service files from coordinator-api/systemd/
  - aitbc-adaptive-learning.service (port 8005)
  - aitbc-advanced-ai.service
  - aitbc-enterprise-api.service
  - aitbc-gpu-multimodal.service (port 8003)
  - aitbc-marketplace-enhanced.service (port 8006)
  - aitbc-modality-optimization.service (port 8004)
  - aitbc-multimodal.service (port 8002)
  - aitbc-openclaw-enhanced.service (port 8007
2026-03-04 12:16:50 +01:00

34 lines
748 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SERVICE_NAME="aitbc-miner"
APP_DIR="/opt/aitbc/apps/miner-node"
VENV_DIR="$APP_DIR/.venv"
LOG_DIR="/var/log/aitbc"
SYSTEMD_PATH="/etc/systemd/system/${SERVICE_NAME}.service"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" >&2
exit 1
fi
install -d "$APP_DIR" "$LOG_DIR"
install -d "/etc/aitbc"
if [[ ! -d "$VENV_DIR" ]]; then
python3 -m venv "$VENV_DIR"
fi
source "$VENV_DIR/bin/activate"
pip install --upgrade pip
pip install -r "$APP_DIR/requirements.txt" || true
deactivate
install -m 644 "$(pwd)/config/systemd/${SERVICE_NAME}.service" "$SYSTEMD_PATH"
systemctl daemon-reload
systemctl enable --now "$SERVICE_NAME"
echo "${SERVICE_NAME} systemd unit installed and started."