View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 8 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Thu Jan 16, 2014 10:18 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
Since this is a vintage machine (2008 software) that still works and I don't want to update (break) it, I've got apt-get sources pointed to an archive apt-get repository from the day - namely debian-etch.

Code:
#Debian repos
deb http://archive.debian.org/debian/ etch main
deb-src http://archive.debian.org/debian/ etch main

I'm trying to set up fail2ban and it's barking about my python version.
I'm not sure if it's telling me that python2.5 is too new for this 0.7.5-2etch version of fail2ban or if it's too old for this version??

Code:
root@mythtv:# apt-get install fail2ban
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libopenal1 libavutil49 libv4l-0 libdca0 libass3 libcdio7 libdirectfb-1.2-0 libqtcore4 mplayer-skin-blue libshout3 libqtgui4 liblua5.1-0 libebml0 libmatroska0
Use 'apt-get autoremove' to remove them.
Suggested packages:
  python-gamin mailx
The following NEW packages will be installed:
  fail2ban
0 upgraded, 1 newly installed, 0 to remove and 130 not upgraded.
Need to get 63.6kB of archives.
After this operation, 500kB of additional disk space will be used.
Get:1 http://archive.debian.org etch/main fail2ban 0.7.5-2etch1 [63.6kB]
Fetched 63.6kB in 2s (25.7kB/s)
Selecting previously deselected package fail2ban.
(Reading database ... 98248 files and directories currently installed.)
Unpacking fail2ban (from .../fail2ban_0.7.5-2etch1_all.deb) ...
Setting up fail2ban (0.7.5-2etch1) ...
xargs: xargs.c:450: main: Assertion `bc_ctl.arg_max <= (131072-2048)' failed.
xargs: xargs.c:450: main: Assertion `bc_ctl.arg_max <= (131072-2048)' failed.
xargs: xargs.c:450: main: Assertion `bc_ctl.arg_max <= (131072-2048)' failed.
INFO: using unsupported version '/usr/bin/python2.5'

If I type this, it says I have a different version:
root@mythtv:/etc/fail2ban# python -V
Python 2.4.4

After trying the install, and I follow the install instructions I try a restart, and get:

Code:
root@mythtv:/etc/fail2ban# /etc/init.d/fail2ban restart
Restarting authentication failure monitor: fail2banTraceback (most recent call last):
  File "/usr/bin/fail2ban-client", line 333, in ?
    if client.start(sys.argv):
  File "/usr/bin/fail2ban-client", line 311, in start
    return self.__processCommand(args)
  File "/usr/bin/fail2ban-client", line 175, in __processCommand
    self.__readConfig()
  File "/usr/bin/fail2ban-client", line 315, in __readConfig
    self.__configurator.readAll()
  File "/usr/share/fail2ban/client/configurator.py", line 56, in readAll
    self.__jails.read()
  File "/usr/share/fail2ban/client/jailsreader.py", line 41, in read
    ConfigReader.read(self, "jail")
  File "/usr/share/fail2ban/client/configreader.py", line 57, in read
    SafeConfigParser.read(self, [bConf, bLocal])
  File "/usr/lib/python2.4/ConfigParser.py", line 267, in read
    self._read(fp, filename)
  File "/usr/lib/python2.4/ConfigParser.py", line 462, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /etc/fail2ban/jail.local, line: 2
' This file was composed for Debian systems from the original one\n'
 failed!


Can anyone read these clues and figure out what I need to do?
Update python? Try a slightly newer version of fail2ban?

Thanks,
Eric

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Last edited by neutron68 on Mon May 26, 2014 8:17 pm, edited 1 time in total.


Top
 Profile  
 
PostPosted: Fri Jan 17, 2014 9:17 am 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
neutron68 wrote:
Code:
root@mythtv:/etc/fail2ban# /etc/init.d/fail2ban restart
...
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /etc/fail2ban/jail.local, line: 2
' This file was composed for Debian systems from the original one\n'
 failed!


Can anyone read these clues and figure out what I need to do?
Update python? Try a slightly newer version of fail2ban?

According to https://launchpad.net/ubuntu/feisty/i38 ... an/0.7.5-1 Pyhon >= 2.4 should be fine for use with fail2ban 0.7.5

Your jail.local file has syntax errors. All lines prior to the section header must be commented out (see http://stackoverflow.com/questions/1328 ... on-headers). Looks like (at least) the "This file was composed for Debian systems from the original one" line does not have a leading pound sign/hash. Here's mine for example:
Code:
root@myth1:/usr/bin# head -18 /etc/fail2ban/jail.conf
# Fail2Ban configuration file.
#
# This file was composed for Debian systems from the original one
#  provided now under /usr/share/doc/fail2ban/examples/jail.conf
#  for additional examples.
#
# To avoid merges during upgrades DO NOT MODIFY THIS FILE
# and rather provide your changes in /etc/fail2ban/jail.local
#
# Author: Yaroslav O. Halchenko <debian@onerussian.com>
#
# $Revision$
#

# The DEFAULT allows a global definition of the options. They can be overridden
# in each jail afterwards.

[DEFAULT]
This is from fail2ban 0.8.6 so yours will likely look different, but make sure all lines prior to the first section header ([DEFAULT] in the above) are commented out.

Having said that, you may be better off just getting the tarball and installing it yourself. The current stable works with Python 2.4 according to http://www.fail2ban.org/wiki/index.php/Requirements


Top
 Profile  
 
PostPosted: Fri Jan 17, 2014 1:05 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
slowtolearn wrote:
Having said that, you may be better off just getting the tarball and installing it yourself. The current stable works with Python 2.4 according to http://www.fail2ban.org/wiki/index.php/Requirements


Thanks for the responses! I think I'll first try and edit the jail file as you suggested and see if it will start working.

Going forward, if a newer fail2learn version works with Python 2.4.4, I'm open to that.
With that vintage .deb file installed from apt-get, I guess I should figure out how to uninstall it first, right?
:?: apt-get remove packagename
:?: dpkg --remove packagename
:?: dpkg -r packagename

Eric

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
PostPosted: Fri Jan 17, 2014 3:19 pm 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
neutron68 wrote:
Going forward, if a newer fail2learn version works with Python 2.4.4, I'm open to that.
With that vintage .deb file installed from apt-get, I guess I should figure out how to uninstall it first, right?

That would be my first thought, yes.

neutron68 wrote:
:?: apt-get remove packagename
:?: dpkg --remove packagename
:?: dpkg -r packagename

Any of those would work, although I normally choose the purge option to also remove configuration files:

Code:
apt-get purge packagename
dpkg --purge packagename

As fail2ban's only dependency is Python, removing the existing package and installing from the tarball should be no problem.


Top
 Profile  
 
PostPosted: Fri Jan 17, 2014 9:24 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
You were right, slowtolearn! There was ONE missing # in my jail.local file!
I think it was a fat-finger error on my part, as the jail.local file was an edited copy of the jail.conf file that was installed by the package.

Just doing that appears to have caused it to restart and run without errors!

Thanks for your keen eye and troubleshooting skills slowtolearn!

Did you change much to your jail.local file?
I only changed the IP addresses to ignore and number of errors it takes to ban and IP address.
The iptables lines were left stock as they were filled with %variables I didn't know what to do with.

I'm trying to use the latest fail2ban and it's complaining about the version of python-central.
I used apt-get purge fail2ban to remove the installed version.
Then I wget downloaded the .deb file of the new package and tried to apply it

Code:
root@mythtv:/myth/backup# dpkg -i fail2ban_0.8.6-3wheezy2_all.deb
Selecting previously deselected package fail2ban.
(Reading database ... 98248 files and directories currently installed.)
Unpacking fail2ban (from fail2ban_0.8.6-3wheezy2_all.deb) ...
dpkg: dependency problems prevent configuration of fail2ban:
 fail2ban depends on python-central (>= 0.6.11); however:
  Version of python-central on system is 0.5.12.
dpkg: error processing fail2ban (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 fail2ban


:?: Is it safe to update to a newer python-central (or full python package) on this KM R5.5 machine? (will it break something?)

:?: Do I need to remove python packages before I up load new or will the new version install over-wright the old?
Same dpkg --purge packagename method?

In addition to the python requirements I see even more dependencies with the current wheezy .deb which are making me wonder if this is going to break something in KM R5.5...
http://packages.debian.org/wheezy/fail2ban

Eric

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
PostPosted: Mon Jan 20, 2014 9:04 am 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
neutron68 wrote:
:?: Is it safe to update to a newer python-central (or full python package) on this KM R5.5 machine? (will it break something?)

:?: Do I need to remove python packages before I up load new or will the new version install over-wright the old?
Same dpkg --purge packagename method?
There are a number of Python scripts, what version those depend on would be a question for the devs.

Installing any latest-version package on a system that old is likely going to break things and/or put you into dependency hell. As you stated the apt-get supplied version of fail2ban worked once you corrected your typo, why would you not use that?


Top
 Profile  
 
PostPosted: Mon Jan 20, 2014 9:24 am 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
slowtolearn wrote:
neutron68 wrote:
:?: Is it safe to update to a newer python-central (or full python package) on this KM R5.5 machine? (will it break something?)

:?: Do I need to remove python packages before I up load new or will the new version install over-wright the old?
Same dpkg --purge packagename method?
There are a number of Python scripts, what version those depend on would be a question for the devs.

Installing any latest-version package on a system that old is likely going to break things and/or put you into dependency hell. As you stated the apt-get supplied version of fail2ban worked once you corrected your typo, why would you not use that?

For now, I am using that older version.

My thought was, if I can easily update to a newer version of fail2ban (hopefully less bugs & more features) I would.
But, if it is dependency hell, then I won't.

In attempting to understand how python is loaded and is accessed, I found that there are 2 versions on the drive in R5.5.
I started a thread to ask if anyone remembers why that is?
http://forum.linhes.org/viewtopic.php?f=6&t=23933

Eric

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
PostPosted: Sun May 25, 2014 7:30 am 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
I got fail2ban working in January 2014 and found that I was suffering from a bug of the older version 0.7.5.
The bug leaves the fail2ban.sock file in place after a crash (such as from a 2+ hour power failure).
When the .sock file is in place fail2ban won't startup.
Googleing the fail2ban .sock bug led me to the conclusion that I needed version 0.8.2 or higher.

I found that the debian archive has fail2ban 0.8.3 in the lenny section:
http://archive.debian.net/lenny/fail2ban

KM R5.5 came with python 2.4.4 and python-central 0.5.12.

fail2ban 0.8.3 needs >= python 2.4.4, >= python-central 0.6.7 and >= lsb-base 2.0-7

So, I got python-central 0.6.8 from the archive:
http://archive.debian.net/lenny/python-central

and lsb-base 3.2-20:
http://archive.debian.net/lenny/lsb-base

All the .deb files installed and fail2ban 0.8.3 works!

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu