mirror of https://github.com/fail2ban/fail2ban
RF: exit codes are positive, so exit(255) instead of exit(-1)
parent
22d37cdce2
commit
d9b9b6ba22
|
@ -69,7 +69,7 @@ class Fail2banClient(Fail2banCmdLine, Thread):
|
|||
# Print a new line because we probably come from wait
|
||||
output("")
|
||||
logSys.warning("Caught signal %d. Exiting" % signum)
|
||||
exit(-1)
|
||||
exit(255)
|
||||
|
||||
def __ping(self, timeout=0.1):
|
||||
return self.__processCmd([["ping"] + ([timeout] if timeout != -1 else [])],
|
||||
|
@ -500,5 +500,5 @@ def exec_command_line(argv):
|
|||
if client.start(argv):
|
||||
exit(0)
|
||||
else:
|
||||
exit(-1)
|
||||
exit(255)
|
||||
|
||||
|
|
|
@ -668,7 +668,7 @@ def exec_command_line(*args):
|
|||
if errors:
|
||||
sys.stderr.write("\n".join(errors) + "\n\n")
|
||||
parser.print_help()
|
||||
sys.exit(-1)
|
||||
sys.exit(255)
|
||||
|
||||
output( "" )
|
||||
output( "Running tests" )
|
||||
|
@ -696,4 +696,4 @@ def exec_command_line(*args):
|
|||
|
||||
fail2banRegex = Fail2banRegex(opts)
|
||||
if not fail2banRegex.start(args):
|
||||
sys.exit(-1)
|
||||
sys.exit(255)
|
||||
|
|
|
@ -212,7 +212,7 @@ class Fail2banServer(Fail2banCmdLine):
|
|||
if not phase.get('done', False):
|
||||
if server: # pragma: no cover
|
||||
server.quit()
|
||||
exit(-1)
|
||||
exit(255)
|
||||
if background:
|
||||
logSys.debug('Starting server done')
|
||||
|
||||
|
@ -223,7 +223,7 @@ class Fail2banServer(Fail2banCmdLine):
|
|||
logSys.error(e)
|
||||
if server: # pragma: no cover
|
||||
server.quit()
|
||||
exit(-1)
|
||||
exit(255)
|
||||
|
||||
return True
|
||||
|
||||
|
@ -238,4 +238,4 @@ def exec_command_line(argv):
|
|||
if server.start(argv):
|
||||
exit(0)
|
||||
else:
|
||||
exit(-1)
|
||||
exit(255)
|
||||
|
|
|
@ -581,7 +581,7 @@ class Fail2banClientTest(Fail2banClientServerBase):
|
|||
# test reload missing jail (direct):
|
||||
self.execCmd(FAILED, startparams, "reload", "~~unknown~jail~fail~~")
|
||||
self.assertLogged("Failed during configuration: No section: '~~unknown~jail~fail~~'")
|
||||
self.assertLogged("Exit with code -1")
|
||||
self.assertLogged("Exit with code 255")
|
||||
self.pruneLog()
|
||||
finally:
|
||||
self.pruneLog()
|
||||
|
|
Loading…
Reference in New Issue