mirror of https://github.com/fail2ban/fail2ban
[systemd-backend] implicit closing journal descriptor by stop filter.
Partially cherry-picked from 0.10 (d153555a07
)
pull/1787/head
parent
0a707d0302
commit
c7ddf1f940
|
@ -15,6 +15,8 @@ releases.
|
||||||
|
|
||||||
|
|
||||||
### Fixes
|
### 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
|
### New Features
|
||||||
|
|
||||||
|
|
|
@ -291,6 +291,13 @@ class FilterSystemd(JournalFilter): # pragma: systemd no cover
|
||||||
except FailManagerEmpty:
|
except FailManagerEmpty:
|
||||||
self.failManager.cleanup(MyTime.time())
|
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
|
logSys.debug((self.jail is not None and self.jail.name
|
||||||
or "jailless") +" filter terminated")
|
or "jailless") +" filter terminated")
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue