| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
./DontCrack \ -path "/Volumes/老固态/Projects/FasterEdge/DontCrack4OpenHarmonyLinuxKernelSide/example/childproc/childproc" \ -args "-mode normal -interval 500ms -lifetime 5s" \ -env "EXTRA_INFO=from_manager RESTART_ENV_COUNT=0" \ -file-log -log-path ./example/logs/ -log-life-day 7 \ -auto-restart -max-retries 2 \ -start-now \ -password 123456
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| path | string | "" | 要管理的程序路径(支持可执行文件、shell脚本等) |
| args | string | "" | 传递给程序的参数(可选) |
| pre | string | "" | 启动前要执行的命令(在sh中执行,可用&&/;/||连接多条命令,默认为空) |
| env | string | "" | 为子进程追加环境变量,如: "PATH=/usr/local/bin:/usr/bin FOO=bar";用空格或分号分隔 |
| auto-restart | bool | false | 是否自动重启 |
| max-retries | int | 3 | 最大重试次数(-1表示无限次,默认3次) |
| start-now | bool | false | 是否立即启动 |
| port | int | 11883 | HTTP服务端口 |
| password | string | "" | 管理进程的密码(可选,默认为空且不开启密码保护) |
| log-capacity | int | 200 | 日志缓存的最大行数(默认200) |
| log-max-line-bytes | int | 1048576 | 单行日志的最大字节数(用于bufio.Scanner,默认1MiB) |
| file-log | bool | false | 是否启用文件日志(默认false) |
| log-path | string | /data/logs/proc_manager/ | 本地日志文件目录(默认/data/logs/proc_manager/,按进程名创建子目录) |
| log-life-day | int | 7 | 本地日志文件保存天数(默认7天,新日志写入时会清理过期文件) |
/startup
password: 密钥(可选 params 参数)
ok
/heartbeat
password: 密钥(可选 params 参数)
{
"version": "1.0.20260826",
"state": "stopped",
"info": "进程管理器正常运行",
"timestamp": "2026-02-24 15:28:04",
"logs": [
"[STDERR] 2026/02/24 15:27:55.647714 env restart count -> 1",
"[STDERR] 2026/02/24 15:27:55.648316 childproc start | pid=32054 | mode=normal | interval=1s | lifetime=5s | msg=",
"[STDERR] 2026/02/24 15:27:55.648345 args: /Volumes/老固态/Projects/FasterEdge/DontCrack4OpenHarmonyLinuxKernelSide/example/childproc/childproc -mode normal -interval 1s -lifetime 5s",
"[STDERR] 2026/02/24 15:27:55.648352 env EXTRA_INFO=from_manager",
"[STDERR] 2026/02/24 15:27:55.648353 env RESTART_ENV_COUNT=0",
"[STDERR] 2026/02/24 15:27:56.668982 tick at 2026-02-24T15:27:56.64879725+08:00",
"[STDERR] stderr burst at 2026-02-24T15:27:56.64879725+08:00",
"[STDERR] 2026/02/24 15:27:57.686757 tick at 2026-02-24T15:27:57.648801166+08:00",
"[STDERR] stderr burst at 2026-02-24T15:27:57.648801166+08:00",
"[STDERR] 2026/02/24 15:27:58.652718 tick at 2026-02-24T15:27:58.648811791+08:00",
"[STDERR] stderr burst at 2026-02-24T15:27:58.648811791+08:00",
"[STDERR] 2026/02/24 15:27:59.668692 tick at 2026-02-24T15:27:59.648816958+08:00",
"[STDERR] stderr burst at 2026-02-24T15:27:59.648816958+08:00",
"[STDERR] 2026/02/24 15:28:00.686286 tick at 2026-02-24T15:28:00.648823625+08:00",
"[STDERR] stderr burst at 2026-02-24T15:28:00.648823625+08:00",
"[STDERR] 2026/02/24 15:28:00.686300 lifetime reached, exiting normally"
],
"process_pid": 0,
"process_path": "/Volumes/老固态/Projects/FasterEdge/DontCrack4OpenHarmonyLinuxKernelSide/example/childproc/childproc",
"restart_count": 0,
"file_type": "binary_executable",
"last_exit_time": "2026-02-24 15:28:00",
"program_args": "-mode normal -interval 1s -lifetime 5s",
"extra_env_raw": "PATH=/opt/tools/bin EXTRA_INFO=from_manager RESTART_ENV_COUNT=0"
}
/shutdown
password: 密钥(可选 params 参数)
ok
| Back | FazBrowse Home | New Git URL |