Files
sentinel-home-ai/scripts/start_edge.sh

26 lines
787 B
Bash
Executable File
Raw 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
# FAM-Edge 启动脚本 (Oracle 端) —— 仅本地调试用
# 生产环境由 systemd fam-edge.service 守护Restart=always/opt/fam-edge/venv/bin/gunicorn
# -w 1 --threads 4 --timeout 1800部署后请用 `sudo systemctl restart fam-edge`。
# 用法: ./scripts/start_edge.sh
set -e
APP_DIR="$(cd "$(dirname "$0")/.." && pwd)/fam-edge"
CONFIG_FILE="$APP_DIR/config/config.yaml"
if [ ! -f "$CONFIG_FILE" ]; then
echo "错误: 配置文件不存在: $CONFIG_FILE"
echo "请复制 config.yaml.example 为 config.yaml 并修改实际值"
exit 1
fi
cd "$APP_DIR"
# 检查虚拟环境
if [ -d "venv" ]; then
source venv/bin/activate
fi
echo "启动 FAM-Edge (端口 5000)..."
exec gunicorn -w 1 -b 0.0.0.0:5000 --timeout 600 src.fam_edge.app:app