Skip to content

Fix certbot cronjob: remove TTY flags and ensure nginx reloads only on certbot success#2153

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/sub-pr-2114
Closed

Fix certbot cronjob: remove TTY flags and ensure nginx reloads only on certbot success#2153
Copilot wants to merge 3 commits intomainfrom
copilot/sub-pr-2114

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

The documented certbot renewal cronjob had two bugs: -it flags on docker exec cause failures in cron (no TTY), and docker compose up exits zero even when certbot fails, causing nginx to reload with stale or no new certs.

Changes

  • Remove -it from docker exec in cronjob — cron has no TTY; flags are only appropriate for interactive use (kept in the manual step 6)
  • Add --abort-on-container-exit --exit-code-from certbot — propagates certbot's exit code so the && chain gates nginx reload on actual certbot success
# Before
0 0 * * 0 cd /home/ubuntu/cht/certbot && docker compose up && docker exec -it cht_nginx_1 nginx -s reload

# After
0 0 * * 0 cd /home/ubuntu/cht/certbot && docker compose up --abort-on-container-exit --exit-code-from certbot && docker exec cht_nginx_1 nginx -s reload

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…ode-from certbot

Co-authored-by: 1yuv <6102813+1yuv@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on nginx restart in certbot cronjob PR Fix certbot cronjob: remove TTY flags and ensure nginx reloads only on certbot success Mar 19, 2026
Copilot AI requested a review from 1yuv March 19, 2026 20:44
Copilot finished work on behalf of 1yuv March 19, 2026 20:44
Base automatically changed from mrjones-plip-patch-1 to main March 25, 2026 20:31
@1yuv 1yuv deleted the copilot/sub-pr-2114 branch March 27, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants