# [SOLVED] Fail2ban accepts python >= 3.x, but gamin does not

## Syl20

Hello all,

When configuring fail2ban on my (old) firewall box, I saw it consumes a significant part of the few available resources on the machine. It seems the default backend, "polling", parses the log files every second, which is not the ideal mean for me. I read that pyinotify has bad interactions with logrotate, and probably performance problems, so I wanted to use gamin.

First problem, net-analyzer/fail2ban has not "pyinotify" nor "gamin" USE flag, so I had to install gamin myself. That doesn't really matter, I know how to use emerge  :Very Happy: . But... 

Second problem, my PYTHON_TARGETS is set to "python2_7 python3_3". Fail2ban is able to run, so it builds, on both versions. And it is launched via python 3.3. Gamin, when "python" USE flag is enabled, does need python 2.7. So when I start fail2ban with the "backend = gamin" parameter set, it complains it fails to intialize the backend "gamin" because "No module named 'gamin'". Then I must launch fail2ban via python 2.7.

I guess it would be possible to avoid all these inconveniences via a "gamin" USE flag available, which would set the dependency with "app-admin/gamin", and would force the user to emerge fail2ban with python 2.7 enabled only. Wouldn't it ?Last edited by Syl20 on Mon Nov 09, 2015 4:06 pm; edited 1 time in total

----------

## joshin

If you haven't, you should file this as a bug at https://bugs.gentoo.org.

----------

## Syl20

A nearly similar bug is closed as WONTFIX...

But I can see DISTUTILS_SINGLE_IMPL=1 in fail2ban ebuilds. This directive seems to force PYTHON_SINGLE_TARGET="python2_7", so I don't need a custom script to launch fail2ban again.  :Very Happy: 

What I don't understand is that line is present for several years in the ebuilds. So I should not had to open this subject seven mouths ago... Maybe the complete reinstall when I switched to amd64 arch resolved old configuration problems on my box...  :Rolling Eyes: 

----------

