From 48ebe3e73594ad43de7246eff36a509e6118e34b Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 22 Sep 2016 20:15:12 +0200 Subject: [PATCH] FilterPyinotify: high cpu load fix - timeout for pyinotify must be set in milliseconds (our time values are floats contain seconds); --- fail2ban/server/filterpyinotify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fail2ban/server/filterpyinotify.py b/fail2ban/server/filterpyinotify.py index 6ddf1691e..56d6ef83b 100644 --- a/fail2ban/server/filterpyinotify.py +++ b/fail2ban/server/filterpyinotify.py @@ -194,8 +194,9 @@ class FilterPyinotify(FileFilter): def run(self): prcevent = pyinotify.ProcessEvent() prcevent.process_default = self.__process_default + ## timeout for pyinotify must be set in milliseconds (our time values are floats contain seconds) self.__notifier = pyinotify.ThreadedNotifier(self.__monitor, - prcevent, timeout=self.sleeptime) + prcevent, timeout=self.sleeptime * 1000) self.__notifier.check_events = self.__check_events self.__notifier.start() logSys.debug("[%s] filter started (pyinotifier)", self.jailName)