- Fixed PID file while started in daemon mode. Thanks to Christian Jobic who submitted a similar patch.

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@680 a942ae1a-1317-0410-a47c-b1dcaea8d605

Conflicts:

	ChangeLog
debian-releases/squeeze
Yaroslav Halchenko 2008-05-06 10:37:14 -04:00
parent 9db84ab727
commit dc9919aed0
2 changed files with 15 additions and 9 deletions

View File

@ -7,6 +7,11 @@
Fail2Ban (version 0.8.2) 2008/03/06
=============================================================
From ver. 0.8.3 (2008/??/??) - stable
----------
- Fixed PID file while started in daemon mode. Thanks to
Christian Jobic who submitted a similar patch.
ver. 0.8.2 (2008/03/06) - stable
----------
- Fixed named filter. Thanks to Yaroslav Halchenko

View File

@ -59,15 +59,6 @@ class Server:
def start(self, sock, force = False):
logSys.info("Starting Fail2ban v" + version.version)
# Creates a PID file.
try:
logSys.debug("Creating PID file %s" % Server.PID_FILE)
pidFile = open(Server.PID_FILE, 'w')
pidFile.write("%s\n" % os.getpid())
pidFile.close()
except IOError, e:
logSys.error("Unable to create PID file: %s" % e)
# Install signal handlers
signal.signal(signal.SIGTERM, self.__sigTERMhandler)
signal.signal(signal.SIGINT, self.__sigTERMhandler)
@ -81,6 +72,16 @@ class Server:
else:
logSys.error("Could not create daemon")
raise ServerInitializationError("Could not create daemon")
# Creates a PID file.
try:
logSys.debug("Creating PID file %s" % Server.PID_FILE)
pidFile = open(Server.PID_FILE, 'w')
pidFile.write("%s\n" % os.getpid())
pidFile.close()
except IOError, e:
logSys.error("Unable to create PID file: %s" % e)
# Start the communication
logSys.debug("Starting communication")
try: