docs: switch production 3002 management to launchd (release binary)

- com.momentry.server + com.momentry.worker manage target/release/momentry
- mark run-server-3002.sh as dev/emergency only (conflicts with launchd)
- AGENTS.md: update startup/log tables, add launchd worker bootstrap note
This commit is contained in:
Accusys
2026-10-02 12:47:55 +08:00
parent e0d04e242f
commit 193af91cd7
2 changed files with 27 additions and 11 deletions
+9 -5
View File
@@ -47,12 +47,13 @@ Rust-based digital asset management system with video analysis and RAG capabilit
### 日誌與啟動
| 服務 | 日誌路徑 | 啟動方式 |
|------|----------|----------|
| Production (3002) | `logs/momentry_3002.log` | `./run-server-3002.sh` |
| Production (3002) | `logs/momentry_3002.log` | **launchd** (`com.momentry.server` + `com.momentry.worker`) |
| Playground (3003) | `logs/momentry_3003.log` | `./run-server-3003.sh` |
| Worker / 歷史 | `logs/nohup_worker_*.log` | 由 worker 自動產生 |
| Worker / 歷史 | `logs/worker_3002.log` | 由 launchd worker 寫入 |
> **注意**: 所有伺服器日誌統一存放於專案內 `logs/` 目錄。
> 啟動腳本會自動 kill 舊程序、重 build(若需要)、並將日誌導向 `logs/`。
> **Production (3002) 正式部署由 launchd 管理**(`~/Library/LaunchAgents/com.momentry.server.plist` + `com.momentry.worker.plist`),兩者皆使用 `target/release/momentry`,KeepAlive 自動重啟。`run-server-3002.sh` 僅供開發時臨時手動啟動(會與 launchd 衝突,勿與 launchd 並用)。
> **⚠️ 啟動 launchd worker 若未註冊**:`launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.momentry.worker.plist`(不是 `load`),worker plist 的 VLM 指向 gemma 8080(8091 已停用)。
## ⚠️ 交叉污染防制 (Cross-Contamination Prevention)
@@ -215,8 +216,11 @@ cargo run -- server --host 0.0.0.0 --port 3002
cargo run --bin momentry_playground -- server
cargo run --bin momentry_playground -- --help
# Start servers (recommended — auto-build & logs to logs/)
./run-server-3002.sh
# Start servers (recommended — production via launchd, dev via scripts)
# Production (3002) is managed by launchd: com.momentry.server + com.momentry.worker
# launchctl start gui/$(id -u)/com.momentry.server
# launchctl start gui/$(id -u)/com.momentry.worker
# (run-server-3002.sh is dev-only and conflicts with launchd — do NOT mix)
./run-server-3003.sh
```