Skip to content

Commit

Permalink
[systemd-backend] implicit closing journal descriptor by stop filter.
Browse files Browse the repository at this point in the history
Partially cherry-picked from 0.10 (d153555)
  • Loading branch information
sebres committed May 19, 2017
1 parent 0a707d0 commit c7ddf1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Expand Up @@ -15,6 +15,8 @@ releases.


### Fixes
* Fix for systemd-backend: fail2ban hits the ulimit (out of file descriptors), see gh-991.
Partially back-ported from v.0.10.

### New Features

Expand Down
7 changes: 7 additions & 0 deletions fail2ban/server/filtersystemd.py
Expand Up @@ -291,6 +291,13 @@ def run(self):
except FailManagerEmpty:
self.failManager.cleanup(MyTime.time())

# close journal:
try:
if self.__journal:
self.__journal.close()
except Exception as e: # pragma: no cover
logSys.error("Close journal failed: %r", e,
exc_info=logSys.getEffectiveLevel()<=logging.DEBUG)
logSys.debug((self.jail is not None and self.jail.name
or "jailless") +" filter terminated")
return True
Expand Down

0 comments on commit c7ddf1f

Please sign in to comment.