feat(v0.2.2): 调试服务器自启动 — InitService.start_auto_scripts()

通用自动启动脚本机制:
- base_config.yaml 新增 auto_start_scripts 配置段
- InitService 在日志服务就绪后扫描并拉起配置的脚本
- 脚本不存在时优雅跳过,不影响框架启动
- 每个脚本独立子进程 + 独立进程组 (os.setsid)
- 框架 shutdown 时自动终止 (SIGTERM → killpg)
- 模块级单例跟踪所有进程,避免重复启动

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
qinglong
2026-06-13 10:58:01 +08:00
parent 9de094ea54
commit dcef1173f2
3 changed files with 103 additions and 4 deletions
+10
View File
@@ -11,6 +11,16 @@ plugins:
auto_load: true
hot_reload: true
max_retry_count: 3
# 自动启动脚本 — 框架启动时后台拉起
auto_start_scripts:
enabled: true
scripts: []
# 示例:
# - name: cyrene_debug
# path: ~/cyrene_debug_server.py
# enabled: true
# args: []
# cwd: ~
# TUI配置
tui:
enabled: true