certbot: `renew --once` exits 0 when the renewed hook fails
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 dstack/certbot/src/bot.rs 开始,跟踪 renew_and_run_hook 如何报告续期 hook 失败,然后继续跟踪 cli/src/main.rs 中的 --once 路径。保留 daemon 循环当前记录日志并继续的行为,但让 --once 在 hook 未运行或未成功退出时返回非零退出码。使用相关的 certbot 命令路径验证这两种语义。
由索引模型根据 Issue 内容生成。
描述
Follow-up to #924.
certbot renew --once is the cron/one-shot entry point. #924 made it invoke the renewed_hook (correct — a one-shot renewal that skips the reload hook leaves the serving process on the old cert), but hook failures are only logged:
// dstack/certbot/src/bot.rs
match std::process::Command::new("/bin/sh").arg("-c").arg(hook).status() {
Ok(status) if status.success() => {}
Ok(status) => error!("renewed hook failed with status: {status}"),
Err(error) => error!("failed to run renewed hook: {error:?}"),
}
Ok(true)
So renew_and_run_hook returns Ok(true) regardless, and certbot renew --once exits 0 even when the hook never ran or exited non-zero. A cron job or systemd OneShot unit wrapping this sees success while the certificate on disk is new and the serving process is still holding the old one — exactly the failure that is supposed to be visible.
Swallowing the error is right for the daemon (the next interval retries), wrong for --once (there is no next interval).
Proposal
Split the two semantics. Options, roughly in order of preference:
- Have
renew_and_run_hookreturn the hook outcome (e.g.Result<Outcome>carryinghook_failed) and let the--oncepath incli/src/main.rsturn a hook failure into a non-zero exit, whilerun()keeps logging and continuing. - Add a
fail_on_hook_error: boolparameter, set from theonceflag.
Either way the daemon loop must keep its current behaviour: a failing hook should not abort the loop.
- 主要语言
- Rust
- 星标
- 555
- 派生
- 97
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 199
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Dstack-TEE/dstack 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
Dstack-TEE/dstack#1384 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
Dstack-TEE/dstack#1301 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
Dstack-TEE/dstack#1300 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
Dstack-TEE/dstack#1299 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
Dstack-TEE/dstack#1298 ·
维护者通常 1 天内回复
查看 Dstack-TEE/dstack 的全部 Issue
相似的 Issue
-
Change output crossing a compactsize boundary leaves the fee slightly below the requested feerate未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
bitcoindevkit/bdk_wallet#578 ·
维护者通常 8 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
521xueweihan/HelloGitHub#3832 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 82/100
canonical/opentelemetry-collector-operator#409 ·
维护者通常 1 天内回复