Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dovecot restart





On 13/09/2026 09:25, Thomas Klausner wrote:
Hi!

I'm rotating my SSL Certs with certbot, also for postfix and dovecot.
Since certbot has no retart plugins for postfix and dovecot, I have a
weekly cronjob that runs '/etc/rc.d/postfix restart' and another one
for '/etc/rc.d/dovecot restart'.

The postfix cronjob sends email immediately; the dovecot one only
after a week, I think when the next dovecot restart cronjob runs.
When I interactively run '/etc/rc.d/dovecot restart' it finishes
quickly.

Does anyone have an idea where that 1-week-delay could come from?


You can get certbot to restart postfix and dovecot when a certificate is renewed. It supports an argument called --deploy-hook which runs a script when the certificate is renewed. The domains renewed are passed into the script in an environment variable called RENEWED_DOMAINS so you can control which services restart based on the domain that is being renewed.

I might also have an idea what's going on with dovecot. There is an oddness in the /etc/rc.d/dovecot startup script when its run from cron jobs relating to stderr. I had problems restarting it in my deploy hook script until I adjusted my restart command for dovecot to:

/etc/rc.d/dovecot restart 2>/dev/null

How I discovered that is lost to history as it was done years ago.

Mike


Home | Main Index | Thread Index | Old Index