chatmail icon indicating copy to clipboard operation
chatmail copied to clipboard

Dovecot is not restarted if service dies

Open adbenitez opened this issue 3 weeks ago • 1 comments

on VPS with low RAM (ex. mine with 4GB) eventually filtermail and opendkim can use a lot of RAM, I suspect this was the reason Dovecot service got killed/died, in any case, this caused hours of downtime because it coincidentally happened while I was sleeping, if dovecot service would be configured to auto-restart, like filtermail service is, there would have been little downtime, since after filtermail got also killed and restarted the memory usage went down again

TL;DR: please set:

Restart=always
RestartSec=30

for dovecot service same way as it is done for filtermail service so if service dies unexpectedly the server can recover without big downtimes until admin notice or is available

adbenitez avatar Nov 15 '25 11:11 adbenitez

/usr/lib/systemd/system/dovecot.service says create /etc/systemd/system/dovecot.service.d/service.conf (or rather /etc/systemd/system/dovecot.service.d/10_restart.conf, then put there

[Service]
Restart=always
RestartSec=30

Same should be done for Postfix.

See also https://www.baeldung.com/linux/systemd-modify-config and https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html

link2xt avatar Nov 15 '25 11:11 link2xt