SHA256
Документировать API и сервис агента-кодера
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="/home/ai/work/SHiNE/SHiNE-server-sha256"
|
||||
SERVICE_DIR="${ROOT_DIR}/SHiNE-agent-bot-coder"
|
||||
UNIT_SRC="${SERVICE_DIR}/scripts/systemd/shine-agent-bot-coder.service"
|
||||
UNIT_DST="${HOME}/.config/systemd/user/shine-agent-bot-coder.service"
|
||||
|
||||
echo "[1/6] Проверка python3..."
|
||||
command -v python3 >/dev/null 2>&1 || { echo "python3 не найден"; exit 1; }
|
||||
|
||||
echo "[2/6] Подготовка папки логов..."
|
||||
mkdir -p "${SERVICE_DIR}/logs"
|
||||
|
||||
echo "[3/6] Копирование user systemd unit..."
|
||||
mkdir -p "$(dirname "${UNIT_DST}")"
|
||||
cp "${UNIT_SRC}" "${UNIT_DST}"
|
||||
|
||||
echo "[4/6] daemon-reload..."
|
||||
systemctl --user daemon-reload
|
||||
|
||||
echo "[5/6] enable + start..."
|
||||
systemctl --user enable --now shine-agent-bot-coder
|
||||
|
||||
echo "[6/6] Статус:"
|
||||
systemctl --user status shine-agent-bot-coder --no-pager
|
||||
|
||||
echo "Готово. Логи: journalctl --user -u shine-agent-bot-coder -f"
|
||||
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=SHiNE Agent Bot Coder (Telegram + Codex queue worker)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/home/ai/work/SHiNE/SHiNE-server-sha256/SHiNE-agent-bot-coder
|
||||
EnvironmentFile=/home/ai/work/SHiNE/SHiNE-server-sha256/SHiNE-agent-bot-coder/.env
|
||||
ExecStart=/usr/bin/python3 /home/ai/work/SHiNE/SHiNE-server-sha256/SHiNE-agent-bot-coder/py_bot_service.py
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
TimeoutStopSec=20
|
||||
SuccessExitStatus=143 0
|
||||
StandardOutput=append:/home/ai/work/SHiNE/SHiNE-server-sha256/SHiNE-agent-bot-coder/logs/service.log
|
||||
StandardError=append:/home/ai/work/SHiNE/SHiNE-server-sha256/SHiNE-agent-bot-coder/logs/service.log
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Reference in New Issue
Block a user