I installed fail2ban but it didn’t start. I found with the following error:
Jun 6 09:51:09 nsec-primary systemd: Starting Fail2Ban Service...
Jun 6 09:51:09 nsec-primary fail2ban-client: ERROR No file(s) found for glob /var/log/mariadb/mariadb.log
Jun 6 09:51:09 nsec-primary fail2ban-client: ERROR Failed during configuration: Have not found any log file for mysqld-auth jail
Jun 6 09:51:09 nsec-primary systemd: fail2ban.service: control process exited, code=exited status=255
Jun 6 09:51:09 nsec-primary systemd: Failed to start Fail2Ban Service.
The system doesn’t run mysql.
I went to the server-manager, disabled the MySQL Auth jail and fail2ban started.
I have a pull request ready, but it works only for mariadb. I’ll leave it up to you.
diff --git a/root/etc/e-smith/templates/etc/fail2ban/jail.local/10MysqlAuth b/root/etc/e-smith/templates/etc/fail2ban/jail.local/10MysqlAuth
index 5df0a23..49d383c 100644
--- a/root/etc/e-smith/templates/etc/fail2ban/jail.local/10MysqlAuth
+++ b/root/etc/e-smith/templates/etc/fail2ban/jail.local/10MysqlAuth
@@ -1,6 +1,6 @@
{
my $mysql = $mysqld{status} || 'disabled';
-return "\n#mysqld not used on this server" unless ($mysql eq 'enabled');
+return "\n#mysqld not used on this server" unless (($mysql eq 'enabled') && (-f '/var/log/mariadb/mariadb.log'));
my $MysqldAuth_status = $fail2ban{MysqldAuth_status} || 'true';
my $TCPPort = $mysqld{TCPPort} || '3306';