LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-15-2024, 07:55 AM   #1
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Rep: Reputation: Disabled
Question Fail2ban-1.0.2 don't start anymore on current, please help


I use the Ponce Slackbuild to build version 1.0.2 from fail2ban but i realized it doesn't start anymore since ~ Apr 3

Code:
# /etc/rc.d/rc.fail2ban start
Starting fail2ban
Traceback (most recent call last):
  File "/usr/bin/fail2ban-client", line 34, in <module>
    from fail2ban.client.fail2banclient import exec_command_line, sys
  File "/usr/lib/python3.11/site-packages/fail2ban/client/fail2banclient.py", line 39, in <module>
    from ..server.utils import Utils
  File "/usr/lib/python3.11/site-packages/fail2ban/server/utils.py", line 56, in <module>
    for name, num in signal.__dict__.iteritems() if name.startswith("SIG"))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'iteritems'
I tried to replace iteritems() by items() but i have zero knowledge in python and it did not solve the issue.


Does anyone have experienced this error and have a fix ?


EDIT:
by the way there is a small typo in paths-slackware.conf from the Slackbuild:

Code:
apache_error_log = /var/log/httpd/*error.log
apache_access_log = /var/log/httpd/*access.log

should be:

apache_error_log = /var/log/httpd/*error_log
apache_access_log = /var/log/httpd/*access_log

Last edited by Eeel; 04-15-2024 at 08:28 AM. Reason: added note about file paths-slackware.conf in Slackbuild
 
Old 04-15-2024, 08:22 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,100

Rep: Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177
sorry, I'm getting old and my mind is getting clouded, but where do I have updated it (the version on SBo is 0.11.2)?
 
1 members found this post helpful.
Old 04-15-2024, 08:24 AM   #3
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
Spend more time to it and found the fix here

Edited the fail2ban.Slackbuild

Quote:
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

./fail2ban-2to3

python setup.py install --root=$PKG
There is a build deprecation notice but it start fine

Quote:
/usr/bin/2to3:3: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
from lib2to3.main import main
Quote:
# fail2ban-client --test
OK: configuration test is successful
 
1 members found this post helpful.
Old 04-15-2024, 08:26 AM   #4
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ponce View Post
sorry, I'm getting old and my mind is getting clouded, but where do I have updated it (the version on SBo is 0.11.2)?
I edited the version inside the .slackbuild and luckily it worked fine for some time.


There is a version for 1.0.2 on Slackers.it that have the same error on startup
 
Old 04-15-2024, 09:06 AM   #5
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,100

Rep: Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177
as it was abandoned on SBo I took maintainership and pushed an update to 1.0.2 switching there too to python3, thanks for the heads-up!
 
4 members found this post helpful.
Old 04-15-2024, 09:13 AM   #6
fourtysixandtwo
Member
 
Registered: Jun 2021
Location: Alberta
Distribution: Slackware...mostly
Posts: 319

Rep: Reputation: 210Reputation: 210Reputation: 210
Quote:
Originally Posted by Eeel View Post
Spend more time to it and found the fix here

Edited the fail2ban.Slackbuild

Code:
 python setup.py install --root=$PKG
There is a build deprecation notice but it start fine
The version on SBo hasn't been updated since 2018 and is meant to be built for python2 so it's not surprising. You should takeover the slackbuild and update it to 1.0.2 on SBo and make sure to change the setup.py line above to python3. (note that on current /usr/bin/python -> python3.11 which adds to the issue you are having)
 
Old 04-15-2024, 09:16 AM   #7
fourtysixandtwo
Member
 
Registered: Jun 2021
Location: Alberta
Distribution: Slackware...mostly
Posts: 319

Rep: Reputation: 210Reputation: 210Reputation: 210
hah, didn't see your post ponce...so nevermind then!
 
Old 04-15-2024, 12:13 PM   #8
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fourtysixandtwo View Post
The version on SBo hasn't been updated since 2018 and is meant to be built for python2 so it's not surprising. You should takeover the slackbuild and update it to 1.0.2 on SBo and make sure to change the setup.py line above to python3. (note that on current /usr/bin/python -> python3.11 which adds to the issue you are having)
Didn't mention i was talking about the Ponce repo version for current.

Starts fine now, i will post here if i encounter error on use.

Thank you for the update.
 
Old 04-15-2024, 01:30 PM   #9
fourtysixandtwo
Member
 
Registered: Jun 2021
Location: Alberta
Distribution: Slackware...mostly
Posts: 319

Rep: Reputation: 210Reputation: 210Reputation: 210
Quote:
Originally Posted by Eeel View Post
Didn't mention i was talking about the Ponce repo version for current.

Starts fine now, i will post here if i encounter error on use.

Thank you for the update.
I understood, but it doesn't matter in this case. The basic rule is that if a fix can be made in the SBo 15.0 repo, it should be made there first, if not then ponce will fix it in his current repo.

The evidence
https://git.slackbuilds.org/slackbui.../ponce/updates
 
Old 04-15-2024, 03:08 PM   #10
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fourtysixandtwo View Post
I understood, but it doesn't matter in this case. The basic rule is that if a fix can be made in the SBo 15.0 repo, it should be made there first, if not then ponce will fix it in his current repo.

The evidence
https://git.slackbuilds.org/slackbui.../ponce/updates
The version on slackbuilds.org works fine with 1.0.2, i only need to change the $VERSION parameter.
 
Old 04-22-2024, 07:18 AM   #11
theodore.s
Member
 
Registered: Jul 2018
Location: Athens, Greece
Distribution: Slackware
Posts: 57

Rep: Reputation: 29
Doesn't work in 15.0.

Quote:
Originally Posted by ponce View Post
as it was abandoned on SBo I took maintainership and pushed an update to 1.0.2 switching there too to python3, thanks for the heads-up!
Hi,

Thank you for taking over the abandoned package, but it looks that it doesn't work in 15.0. After upgrading, running fail2ban-client returns this:

Code:
ERROR: No module named configparser
2024-04-22 15:09:03,771 fail2ban                [12149]: ERROR   Init of command line failed
After installing ConfigParser from slackbuilds, returns this:

Code:
ERROR: type object 'SafeConfigParser' has no attribute '_interpolate_some'
2024-04-22 14:57:58,795 fail2ban                [10749]: ERROR   Init of command line failed
I am not familiar with python and I can't troubleshoot further. Any help?
 
Old 04-22-2024, 08:14 AM   #12
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,100

Rep: Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177Reputation: 4177
sorry theodore, I made a little oversight: please change line 75 of the SlackBuild from
Code:
python setup.py install --root=$PKG
to
Code:
python3 setup.py install --root=$PKG
 
1 members found this post helpful.
Old 04-22-2024, 08:21 AM   #13
theodore.s
Member
 
Registered: Jul 2018
Location: Athens, Greece
Distribution: Slackware
Posts: 57

Rep: Reputation: 29
Fixed.

Quote:
Originally Posted by ponce View Post
sorry theodore, I made a little oversight: please change line 75 of the SlackBuild from
Code:
python setup.py install --root=$PKG
to
Code:
python3 setup.py install --root=$PKG
Yes, that worked, thank you!

Now I have one more reason besides white space to not like python, the v2/v3 problems...
 
  


Reply

Tags
current, fail2ban



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] server not working anymore with local network... please, please HELP! masavini Linux - Networking 17 07-12-2014 02:37 PM
[SOLVED] Fail2Ban or Similar build for slackware 14-Current cooholio Slackware 13 06-26-2013 05:24 PM
NIC not installed anymore, KDE not installed anymore, LILO duplicate Volume ID error scottad Slackware 2 03-31-2012 12:13 AM
[SOLVED] XFCE keyboard shortcuts don't work anymore [-current] kaapa Slackware 5 06-14-2011 08:13 PM
Fail2ban regex help please wvroger Linux - Security 1 05-23-2010 07:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration