All checks were successful
Build and Release / build-and-test (arm64, alpine) (push) Successful in -13s
Build and Release / build-and-test (amd64, alpine) (push) Successful in -6s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in -7s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 7s
Build and Release / release (push) Successful in 21s
- 将 Debian 包仓库从 bookworm/trixie 双发行版改为通用 stable 仓库 - 新增完整的 llmdoc 文档系统,包含架构、指南和参考文档 - 更新 README.md 和部署指南以反映新的仓库配置 - 添加 .gitignore 文件
49 lines
1.2 KiB
Markdown
49 lines
1.2 KiB
Markdown
# Systemd 服务配置架构
|
|
|
|
## 1. 身份
|
|
|
|
- **定义:** xxxigcc-proxy 的 systemd 服务配置
|
|
- **目的:** 提供一个安全、可靠的服务管理机制
|
|
|
|
## 2. 核心配置
|
|
|
|
`debian/xxxigcc-proxy.service` 文件定义了服务的关键特性:
|
|
|
|
### 启动控制
|
|
- `Type=simple`:直接启动进程
|
|
- `After=network.target`:确保网络就绪后启动
|
|
- `Restart=always`:服务意外停止时自动重启
|
|
- `RestartSec=10`:重启间隔 10 秒
|
|
|
|
### 安全设置
|
|
- `NoNewPrivileges=true`:禁止进程获取新权限
|
|
- `PrivateTmp=true`:隔离临时文件目录
|
|
- `ProtectSystem=strict`:限制对系统目录的修改
|
|
- `ProtectHome=true`:保护用户主目录
|
|
|
|
### 资源限制
|
|
- `LimitNOFILE=65535`:最大文件描述符数
|
|
- `LimitNPROC=4096`:最大进程数
|
|
|
|
### 用户和组
|
|
- 以 `xxxigcc-proxy` 专用用户运行
|
|
- 降低潜在安全风险
|
|
|
|
### 日志管理
|
|
- 使用 systemd journal 记录日志
|
|
- 标准输出和错误重定向到日志系统
|
|
|
|
## 3. 执行流程
|
|
|
|
1. systemd 检查网络就绪
|
|
2. 以 `xxxigcc-proxy` 用户启动进程
|
|
3. 使用指定配置文件和日志路径启动
|
|
4. 持续监控服务状态
|
|
5. 必要时自动重启服务
|
|
|
|
## 4. 设计原则
|
|
|
|
- 最小权限原则
|
|
- 服务可靠性
|
|
- 安全隔离
|
|
- 日志完整性 |