buglab/run.sh

24 lines
700 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
if [ -z "$1" ]; then
echo "Использование: $0 <путь_к_бинарнику> [путь_к_логу]"
exit 1
fi
BINARY="$1"
LOG_FILE="${2:-/home/node/forge/buglab/storage/optimizer.log}"
if [ ! -f "$BINARY" ]; then
echo "[!] Бинарник '$BINARY' не найден!"
exit 1
fi
# Запуск в фоне
nohup "$BINARY" > "$LOG_FILE" 2>&1 &
PID=$!
echo "[*] Процесс '$BINARY' запущен с PID: $PID"
echo "[*] Логи пишутся в: $LOG_FILE"
# Лимит 160% CPU (80% от каждого из двух ядер)
cpulimit -p $PID -l 160 -z -b > /dev/null 2>&1
echo "[+] cpulimit успешно привязан к PID $PID (лимит 160%)"