# rpctl `rpctl` 是四款 RP 本地控制 CLI,用于在实验服务器本地独立启动、停止和观察单个 RP/profile 的 all5 run。 ## 部署 ```bash mkdir -p /root/rpki_4rp_ctl rsync -a rpki_2/rpki/scripts/rpctl/ root@47.77.237.41:/root/rpki_4rp_ctl/ rsync -a specs/develop/20260707_3/feature100_four_rp_interval_archive/runtime_bundle/ root@47.77.237.41:/root/rpki_4rp_ctl_runtime_bundle/ ssh root@47.77.237.41 'cd /root/rpki_4rp_ctl && ./rpctl init --bundle /root/rpki_4rp_ctl_runtime_bundle' ``` `--bundle` 目录需要包含 #100 runtime bundle 的 `bin/`、`lib/`、`fixtures/`、`scripts/` 和 `versions.json`。不要使用早期 precheck 目录作为标准 bundle,因为它可能缺少 FORT 运行所需动态库。 ## 常用命令 ```bash ./rpctl list ./rpctl status ./rpctl start --rp ours-pp-object-cache --interval 10m --runs 6 --rirs all5 ./rpctl start --rp routinator --interval 0 --runs 1 --rirs apnic ./rpctl continue --run-id --runs 3 --interval 10m ./rpctl tail ./rpctl show ./rpctl show --failed ./rpctl view --run-id 20260709T081122Z_ours-pp-object-cache_2runs_600s ./rpctl delete --run-id --dry-run ./rpctl paths ./rpctl stop ./rpctl stop --force ``` ## Profile | 输入别名 | 实际 profile | |---|---| | `ours`, `ours-rp`, `ours-cached` | `ours-pp-object-cache` | | `ours-baseline` | `ours-no-cache` | | `routinator` | `routinator-latest-release` | | `rpki-client` | `rpki-client-latest-release` | | `fort` | `fort-latest-release` | ## 数据目录 默认部署根目录就是 `rpctl` 所在目录,例如 `/root/rpki_4rp_ctl`。 ```text /root/rpki_4rp_ctl/ bin/ lib/ fixtures/ scripts/ state/current.json logs/runner-*.log runs///profiles//runs/run_0001/ ``` 每个 run 目录包含 `stdout.log`、`stderr.log`、`process-time.txt`、`exit-code.txt`、`run-meta.json` 以及各 RP 产物。 ## 历史查看与删除 ```bash ./rpctl show ./rpctl show --failed ./rpctl show --rp ours --limit 20 ./rpctl show --json ``` `show` 会扫描 `runs///`,展示历史 `run_id`、状态、start/end 时间、失败 run 列表、运行参数、产物数量和目录路径。 默认表格为了可读性不显示完整路径;需要路径时使用: ```bash ./rpctl show --paths ``` ```bash ./rpctl view --run-id ./rpctl view --rp ours --run-id ./rpctl view --run-id --command ./rpctl view --run-id --json ``` `view` 用于查看指定历史 run 的摘要和每一轮子 run 明细,包括运行耗时、max RSS、VRP/VAP 数量、同步模式、exit code 和目录路径。 ```bash ./rpctl delete --run-id --dry-run ./rpctl delete --run-id --yes ./rpctl delete --rp ours --run-id --yes ``` `delete` 只能删除非 running 的 run。建议先用 `--dry-run` 确认路径;真实删除必须显式加 `--yes`。删除内容包括 `runs///` 和匹配的 `logs/runner-*.log`。 如果历史 run 是中途停止的 incomplete run,且没有 `run-meta.json`、normalized 文件或原始输出文件,则 VRP/VAP、wall、RSS 会显示为 `-`,表示该 run 没有可统计产物。 ## 续跑已有成功 run ```bash ./rpctl continue --run-id --runs 3 --interval 10m ./rpctl continue --rp routinator --run-id --runs 1 --interval 0 ``` `continue` 只接受已经成功结束的历史 run id,并在原目录下追加 `run_000N`。它不会清理 profile state,也不会给 RP 强制传 snapshot-only 参数;后续 run 是 delta 还是 snapshot 由各 RP 根据自身持久状态决定。 续跑会复用原 run 的 RIR 集合,避免在同一个 state 目录里混用不同 scope。若同一个 `run-id` 在多个 profile 下存在,需要加 `--rp` 消歧。