mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
wrapped with exception handling to avoid crash during pidlock remove
This commit is contained in:
parent
d922899bba
commit
ee0ce118a9
1 changed files with 4 additions and 1 deletions
|
|
@ -70,6 +70,9 @@ class PIDLock:
|
|||
logSys.debug("Removed PID lock " + self.path)
|
||||
except OSError:
|
||||
logSys.error("Unable to remove PID lock " + self.path)
|
||||
# AttributeError if self.path wasn't specified yet
|
||||
except AttributeError:
|
||||
logSys.debug("PID lock not removed because not defined yet")
|
||||
|
||||
def exists(self):
|
||||
""" Returns the current PID if Fail2Ban is running or False
|
||||
|
|
@ -103,4 +106,4 @@ class PIDLock:
|
|||
def __setattr__(self, attr, value):
|
||||
""" Delegate access to implementation """
|
||||
return setattr(self.__instance, attr, value)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue