Appbead Blog

Fix Errors Reported in syslog for Debian 8 Jessie

After setup mail server on Debian 8 (Jessie) successfully, several errors occurred in /var/log/syslog.

dovecot[487]: Error: systemd listens on port 143, but it's not configured in Dovecot. Closing.

For security consideration, when configure Dovecot daemon, the IMAPS port 993 is the only one opened. Clearly, the error is caused by systemd socket of Dovecot.

$ sudo systemctl status dovecot.socket
● dovecot.socket - Dovecot IMAP/POP3 email server activation socket
   Loaded: loaded (/lib/systemd/system/dovecot.socket; enabled)
   Active: failed (Result: resources) since Sat 2015-05-09 20:18:13 CST; 1h 46min ago
   Listen: 0.0.0.0:143 (Stream)
           [::]:143 (Stream)
           0.0.0.0:993 (Stream)
           [::]:993 (Stream)

The solution is modify dovecot.socket file to indicate systemd the port 143 is no need to listen.

As the systemd prefers files in /etc/systemd over those in /lib/systemd, the correct way to modify socket/service file is copying the file dovecot.socket to /etc/systemd/ firstly, and let systemd know it.

$ sudo cp /lib/systemd/system/dovecot.socket /etc/systemd/system/
$ sudo systemctl reenable dovecot.socket
Removed symlink /etc/systemd/system/sockets.target.wants/dovecot.socket.
Created symlink from /etc/systemd/system/sockets.target.wants/dovecot.socket to /etc/systemd/system/dovecot.socket.

Then modify the copied socket file. Here we comment out the lines include 143 port in file dovecot.socket

$ sudo sed -i '/:143$/s/^/#/' /etc/systemd/system/dovecot.socket
$ sudo systemctl stop dovecot.service
$ sudo systemctl start dovecot.socket
$ sudo systemctl status dovecot.socket
● dovecot.socket - Dovecot IMAP/POP3 email server activation socket
   Loaded: loaded (/etc/systemd/system/dovecot.socket; enabled)
   Active: active (listening) since Sat 2015-05-09 22:12:05 CST; 56s ago
   Listen: 0.0.0.0:993 (Stream)
           [::]:993 (Stream)

The error will be gone when rebooting system, however it's not necessary to reboot at all.

fail2ban[475]: Starting authentication failure monitor: fail2banWARNING 'ignoreregex' not defined in 'Definition'. Using default one: ''

After check the conf files relative to mail server in /etc/fail2ban/filter.d/, we found the problem file is postfix-sasl.conf

Solution: Add a line "ignoreregex =" after failregex definition:

$ sudo sed -i -e '/^failregex\b/{:a;n;/^$/!ba;i\ \nignoreregex = ' -e '}' /etc/fail2ban/filter.d/postfix-sasl.conf

Then check if the WARNING is gone by run:

$ sudo service fail2ban restart
$ sudo tail /var/log/syslog

console-kit-daemon GLib-CRITICAL

The error message from syslog:

console-kit-daemon[711]: console-kit-daemon[711]: GLib-CRITICAL: Source ID 962 was not found when attempting to remove it
console-kit-daemon[711]: (process:8623): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

ConsoleKit only manages console logins in graphical mode, so it's useless on a debian 8 based headless server[1]. The way to remove and stop console kit:

$ sudo apt-get remove consolekit
$ sudo apt-get autoremove

Comments