refactor: use nginx -s reload instead of systemd

- doc: add comment
This commit is contained in:
2026-08-17 10:10:14 +08:00
parent 79f18fcdea
commit f536987a7e
62 changed files with 2216 additions and 598 deletions
+17 -6
View File
@@ -1,4 +1,7 @@
// Package systemd defines the exact systemd boundary used by native executors.
// Package systemd 定义原生执行器所依赖的精确 systemd 边界。
//
// 该包声明 systemd 操作所需的最小抽象,具体实现见 systemctl.go
// 它直接调用 systemctl 可执行文件,绝不经过 shell。
package systemd
import (
@@ -6,19 +9,27 @@ import (
"errors"
)
// ErrUnitNotFound 表示未找到指定的 systemd 单元。
var ErrUnitNotFound = errors.New("systemd unit not found")
// Unit is the systemd state required for idempotent start and stop inspection.
// Unit 执行幂等启停检查所需的 systemd 状态。
type Unit struct {
Name string
LoadState string
// Name 表示单元名称。
Name string
// LoadState 表示单元的加载状态。
LoadState string
// ActiveState 表示单元的活动状态。
ActiveState string
SubState string
// SubState 表示单元的子状态。
SubState string
}
// Manager performs direct systemd operations without invoking a shell.
// Manager 在不调用 shell 的前提下直接执行 systemd 操作。
type Manager interface {
// Inspect 检查指定单元并返回其状态。
Inspect(context.Context, string) (Unit, error)
// Start 启动指定单元。
Start(context.Context, string) error
// Stop 停止指定单元。
Stop(context.Context, string) error
}