certbot 真的會更新我的憑證嗎?

certbot 真的會更新我的憑證嗎?

看了下/etc/cron.d/certbot,我覺得不會!該文件包含以下行:

0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew

而且,除非我讀錯了,否則只有當有一個名為/usr/bin/certbot(there is) 的可讀可執行檔並且如果有不是一個名為/run/systemd/system(但有,即使它是空的)的目錄。

那麼我是對的,這個certbot -q renew鑽頭永遠不會運作嗎?是否還有其他地方也會觸發更新? (我以為裡面可能有東西,/run/systemd/system因為正在檢查,但正如我所說,沒有。出於好奇,為什麼這個小腳本檢查是否不存在/run/systemd/system

這是運行最新版本certbot(v1.18.0,昨天使用安裝官方說明)在 Ubuntu 18.04 上。

順便說一句,我已經跑了:

test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot renew --dry-run

作為 root 在命令列上運行,它會立即退出,退出狀態為 1。

答案1

如果系統使用systemd,它將作為 systemd 服務運行,由時間觸發。

如果運行,systemctl status certbot.timer您將獲得從 systemd 觸發的服務的狀態certbot

這就是為什麼 cron 腳本被配置為在電腦上偵測到 systemd 時不執行更新的原因。

相關內容