Dashboard displays Dovecot not running but it is

This server is running for around 5 months. Centos 7, Postfix/Dovecot, up-to-date.
Looking at my Dashboard I see Dovecot is “not running”. I put it to “run” but its state still is displayed as stopped.
I don’t see problems. tailf /var/log/maillog displays dovecot activity.
ps aux | grep dovecot

dovenull 24957  0.0  0.0  44232  4256 ?        S    09:57   0:00 dovecot/imap-login
user1  24966  0.0  0.0  17884  2672 ?        S    09:57   0:00 dovecot/imap
dovecot  30494  0.0  0.0  34520  2380 ?        S    19:30   0:00 dovecot/auth
root     30495  0.0  0.0   9744  1116 ?        S    19:30   0:00 dovecot/ssl-params
root     30513  0.0  0.0  38976  2788 ?        S    19:30   0:00 dovecot/auth -w
root     31185  0.0  0.0 112716   972 pts/0    S+   19:31   0:00 grep --color=auto dovecot
root     31848  0.0  0.0  16212  1224 ?        Ss   feb25   0:17 /usr/sbin/dovecot
dovecot  31849  0.0  0.0   9748  1116 ?        S    feb25   0:06 dovecot/anvil
root     31850  0.0  0.0   9880  1304 ?        S    feb25   0:05 dovecot/log
root     31853  0.0  0.1  22548 12108 ?        S    feb25   0:24 dovecot/config

I remember it also happened after “Current Certificate” -> “Copy to Dovecot”. This button didn’t disappear like the others after clicking on them.
This time I didn’t do anything. Maybe a Let’s Encrypt auto renew is involved.

Hi,

What is the output of:

systemctl status dovecot

The state should be active (running), I assume it’s not to various reasons.

Can you connect to IMAP?

Hi Ilia,
These are the answers to your questions.

telnet MyHost.com 143

Trying IP...
Connected to MyHost.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.

systemctl status dovecot

 dovecot.service - Dovecot IMAP/POP3 email server
   Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since sáb 2020-02-29 18:59:51 -03; 18h ago
     Docs: man:dovecot(1)
           http://wiki2.dovecot.org/
  Process: 31847 ExecStop=/usr/bin/doveadm stop (code=exited, status=75)
  Process: 8919 ExecStart=/usr/sbin/dovecot (code=exited, status=89)
  Process: 8912 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
 Main PID: 1425 (code=exited, status=0/SUCCESS)

feb 29 18:59:51 host.MyHost.com systemd[1]: Starting Dovecot IMAP/POP3 email server...
feb 29 18:59:51 host.MyHost.com dovecot[8919]: Fatal: Dovecot is already running? Socket already exists: /var...ogin
feb 29 18:59:51 host.MyHost.com dovecot[8919]: master: Fatal: Dovecot is already running? Socket already exis...ogin
feb 29 18:59:51 host.MyHost.com systemd[1]: dovecot.service: control process exited, code=exited status=89
feb 29 18:59:51 host.MyHost.com systemd[1]: Failed to start Dovecot IMAP/POP3 email server.
feb 29 18:59:51 host.MyHost.com systemd[1]: Unit dovecot.service entered failed state.
feb 29 18:59:51 host.MyHost.com systemd[1]: dovecot.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

Thank you

Have you tried killing the process and restarting it again?

Not yet. Because it is not affecting email system I let it in that state to allow tests you might suggest.
Maybe there’s a bug somewhere.
I repeat I had the same issue after trying to apply Let’sEncrypt cert to Dovecot via “Copy to Dovecot” button in the past

There was a bug in this regard, that we fixed few weeks ago.

Which process should I kill?

dovenull  5297  0.0  0.0  44240  4256 ?        S    15:19   0:00 dovecot/imap-login
user1     5300  0.0  0.0  19600  3652 ?        S    15:19   0:00 dovecot/imap
dovecot  10759  0.0  0.0  34520  2380 ?        S    18:47   0:00 dovecot/auth
root     11836  0.0  0.0   9744  1116 ?        S    18:48   0:00 dovecot/ssl-params
root     11839  0.1  0.0  38976  2792 ?        S    18:49   0:00 dovecot/auth -w
dovenull 12142  0.0  0.0  44240  4260 ?        S    18:49   0:00 dovecot/imap-login
user1    12166  0.0  0.0  17904  2436 ?        S    18:49   0:00 dovecot/imap
root     12508  0.0  0.0 112716   972 pts/0    S+   18:50   0:00 grep --color=auto dovecot
dovenull 28774  0.0  0.0  44240  4256 ?        S    18:27   0:00 dovecot/imap-login
user1    28792  0.0  0.0  18892  4056 ?        S    18:27   0:00 dovecot/imap
root     31848  0.0  0.0  16212  1232 ?        Ss   feb25   0:21 /usr/sbin/dovecot
dovecot  31849  0.0  0.0   9748  1116 ?        S    feb25   0:07 dovecot/anvil
root     31850  0.0  0.0   9880  1304 ?        S    feb25   0:06 dovecot/log
root     31853  0.0  0.1  22548 12108 ?        S    feb25   0:29 dovecot/config

All of them.

pkill dovecot

or forcefully, if above fails:

pkill -9 dovecot

However, you could simply run:

systemctl force-reload dovecot
1 Like

Done.
I “Copy to Dovecot” current certificate and it was applied correctly, the button is not displayed anymore.
I left wondering why Dovecot was displayed as not running in Dashboard.
Thank you

It had to be restarted manually. Next Virtualmin release will fix that though.