Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

certbot: `renew --once` exits 0 when the renewed hook fails

オープン
#1,012 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
64/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust
領域
cli

調査の方向性

dstack/certbot/src/bot.rs から始め、renew_and_run_hook が更新フックの失敗をどのように報告しているかを追跡し、その後 cli/src/main.rs の --once パスを追ってください。daemon ループの現在のログ記録して継続する動作は維持しますが、フックが実行されないか正常に終了しなかった場合に、--once がゼロ以外の終了コードを返すようにしてください。関連する certbot のコマンドパスを使って、両方のセマンティクスを検証してください。

索引モデルが issue の本文から書いたものです。

説明

bug rust

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:

  1. Have renew_and_run_hook return the hook outcome (e.g. Result<Outcome> carrying hook_failed) and let the --once path in cli/src/main.rs turn a hook failure into a non-zero exit, while run() keeps logging and continuing.
  2. Add a fail_on_hook_error: bool parameter, set from the once flag.

Either way the daemon loop must keep its current behaviour: a failing hook should not abort the loop.

主要言語
Rust
スター
551
フォーク
97
平均マージ
19時間 22分
マージ済み PR(30日)
109

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Dstack-TEE/dstack のほかの issue

Dstack-TEE/dstack の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。