Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 504926 - net-analyzer/fail2ban-0.9.0-r1 should print optional dependencies of dev-lang/python[sqlite] and sys-apps/systemd[python]
Summary: net-analyzer/fail2ban-0.9.0-r1 should print optional dependencies of dev-lang...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Netmon Herd
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-03-17 23:55 UTC by Jaakko Perttilä
Modified: 2014-03-20 15:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fail2ban-0.9.0-r1.ebuild-elog.patch (fail2ban-0.9.0-r1.ebuild-elog.patch,1.59 KB, patch)
2014-03-18 16:28 UTC, Jeroen Roovers (RETIRED)
Details | Diff
fail2ban-0.9.0-r1.ebuild-elog.patch (fail2ban-0.9.0-r1.ebuild-elog.patch,1.56 KB, patch)
2014-03-18 16:36 UTC, Jeroen Roovers (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaakko Perttilä 2014-03-17 23:55:46 UTC
From version 0.9.0 changelog:
Added fail2ban persistent database
- needs dev-lang/python[sqlite]

Added systemd journal backend
- needs sys-apps/systemd[python]

I'm not using systemd, so I haven't tested with that.


Reproducible: Always

Actual Results:  
fail2ban-server --version
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.3/fail2ban-server", line 28, in <module>
    from fail2ban.server.server import Server
  File "/usr/lib64/python3.3/site-packages/fail2ban/server/server.py", line 34, in <module>
    from .database import Fail2BanDb
  File "/usr/lib64/python3.3/site-packages/fail2ban/server/database.py", line 27, in <module>
    import sqlite3
ImportError: No module named 'sqlite3'
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-18 16:26:07 UTC
Index: fail2ban-0.9.0-r1.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-analyzer/fail2ban/fail2ban-0.9.0-r1.ebuild,v
retrieving revision 1.1
diff -u -B -r1.1 fail2ban-0.9.0-r1.ebuild
--- fail2ban-0.9.0-r1.ebuild    17 Mar 2014 00:43:21 -0000      1.1
+++ fail2ban-0.9.0-r1.ebuild    18 Mar 2014 16:25:41 -0000
@@ -78,10 +78,19 @@
                elog "You are upgrading from version 0.6.x, please see:"
                elog "http://www.fail2ban.org/wiki/index.php/HOWTO_Upgrade_from_0.6_to_0.8"
        fi
-       if ! has_version ${CATEGORY}/${PN} && \
-               ! has_version dev-python/pyinotify && ! has_version app-admin/gamin; then
-               elog "For most jail.conf configurations, it is recommended you install either"
-               elog "dev-python/pyinotify or app-admin/gamin (in order of preference)"
-               elog "to control how log file modifications are detected"
+       if ! has_version ${CATEGORY}/${PN}; then
+               if ! has_version dev-python/pyinotify && ! has_version app-admin/gamin; then
+                       elog "For most jail.conf configurations, it is recommended you install either"
+                       elog "dev-python/pyinotify or app-admin/gamin (in order of preference)"
+                       elog "to control how log file modifications are detected"
+               fi
+               if ! built_with_use dev-lang/python sqlite; then
+                       elog "If you want to use ${PN}'s persistent database, then reinstall"
+                       elog "dev-lang/python with USE=sqlite"
+               fi
+               if has_version sys-apps/systemd && ! built_with_use sys-apps/systemd python; then
+                       elog "If you want to track logins through sys-apps/systemd's"
+                       elog "journal backend, then reinstall sys-apps/systemd with USE=python"
+               fi
        fi
 }


Something like this?
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-18 16:28:10 UTC
Created attachment 372948 [details, diff]
fail2ban-0.9.0-r1.ebuild-elog.patch
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-18 16:33:23 UTC
Comment on attachment 372948 [details, diff]
fail2ban-0.9.0-r1.ebuild-elog.patch

Apparently built_with_use is deprecated.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-18 16:36:32 UTC
Created attachment 372950 [details, diff]
fail2ban-0.9.0-r1.ebuild-elog.patch
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-19 14:27:50 UTC
It's in the tree, too. Could someone please test this?
Comment 6 Timo Gurr (RETIRED) gentoo-dev 2014-03-19 14:47:23 UTC
For me it's still failing with:

# fail2ban-server 
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/fail2ban-server", line 28, in <module>
    from fail2ban.server.server import Server
  File "/usr/lib64/python2.7/site-packages/fail2ban/server/server.py", line 34, in <module>
    from .database import Fail2BanDb
  File "/usr/lib64/python2.7/site-packages/fail2ban/server/database.py", line 27, in <module>
    import sqlite3
ImportError: No module named sqlite3

even though I configured fail2ban to not use any database in /etc/fail2ban/fail2ban.local:

[Definition]
dbfile = None

And just to be sure it's not the override, I also changed it in /etc/fail2ban/fail2ban.conf:

# Options: dbfile
# Notes.: Set the file for the fail2ban persistent data to be stored.
#         A value of ":memory:" means database is only stored in memory
#         and data is lost once fail2ban is stops.
#         A value of "None" disables the database.
# Values: [ None :memory: FILE ] Default: /var/lib/fail2ban/fail2ban.sqlite3
#dbfile = /var/lib/fail2ban/fail2ban.sqlite3
dbfile = None

So it seems dev-lang/python[sqlite] is mandatory for fail2ban to work if a database is used or not.

On a side note, the elog regarding the "HOWTO_Upgrade_from_0.6_to_0.8" should probably be removed in the 0.9.x ebuilds as well, since there were major changes in the configuration and the upgrade path described in the wiki for 0.8 doesn't apply any more.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-19 16:37:36 UTC
(In reply to Timo Gurr from comment #6)
> For me it's still failing with:
> 
> # fail2ban-server 
> Traceback (most recent call last):
>   File "/usr/lib/python-exec/python2.7/fail2ban-server", line 28, in <module>
>     from fail2ban.server.server import Server
>   File "/usr/lib64/python2.7/site-packages/fail2ban/server/server.py", line
> 34, in <module>
>     from .database import Fail2BanDb
>   File "/usr/lib64/python2.7/site-packages/fail2ban/server/database.py",
> line 27, in <module>
>     import sqlite3
> ImportError: No module named sqlite3
> 
> even though I configured fail2ban to not use any database in
> /etc/fail2ban/fail2ban.local:

[...]

> So it seems dev-lang/python[sqlite] is mandatory for fail2ban to work if a
> database is used or not.

That's not what _this_ bug report is about.

> On a side note, the elog regarding the "HOWTO_Upgrade_from_0.6_to_0.8"
> should probably be removed in the 0.9.x ebuilds as well, since there were
> major changes in the configuration and the upgrade path described in the
> wiki for 0.8 doesn't apply any more.

Now you're confusing three issues.
Comment 8 Jaakko Perttilä 2014-03-20 12:45:41 UTC
It seems someone has fixed the requirement for dev-lang/python[sqlite].
Here is the patch:
https://github.com/fail2ban/fail2ban/pull/659
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-20 15:20:46 UTC
(In reply to Jaakko Perttilä from comment #8)
> It seems someone has fixed the requirement for dev-lang/python[sqlite].
> Here is the patch:
> https://github.com/fail2ban/fail2ban/pull/659

Wrong bug.
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-20 15:55:38 UTC
Assumed fixed.