Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: commits

[3756] cherokee/trunk/admin/server.py: Removes the Unix socket if it already exists while launching an

 

 

Cherokee commits RSS feed   Index | Next | Previous | View Threaded


cherokee at cherokee-project

Oct 28, 2009, 10:28 AM

Post #1 of 1 (57 views)
Permalink
[3756] cherokee/trunk/admin/server.py: Removes the Unix socket if it already exists while launching an

Revision: 3756
http://svn.cherokee-project.com/changeset/3756
Author: alo
Date: 2009-10-28 18:28:29 +0100 (Wed, 28 Oct 2009)

Log Message:
-----------
Removes the Unix socket if it already exists while launching an
instance of server.py. Most probably the file is there because the
previous server.py died and didn't remove the old unix socket file.

Modified Paths:
--------------
cherokee/trunk/admin/server.py

Modified: cherokee/trunk/admin/server.py
===================================================================
--- cherokee/trunk/admin/server.py 2009-10-28 00:39:48 UTC (rev 3755)
+++ cherokee/trunk/admin/server.py 2009-10-28 17:28:29 UTC (rev 3756)
@@ -217,6 +217,14 @@
if scgi_port.isdigit():
srv = pyscgi.ServerFactory (True, handler_class=Handler, host="127.0.0.1", port=int(scgi_port))
else:
+ # Remove the unix socket if it already exists
+ try:
+ mode = os.stat (scgi_port)[stat.ST_MODE]
+ if stat.S_ISSOCK(mode):
+ os.unlink (scgi_port)
+ except OSError:
+ pass
+
srv = pyscgi.ServerFactory (True, handler_class=Handler, unix_socket=scgi_port)

srv.socket.settimeout (MODIFIED_CHECK_ELAPSE)

Cherokee commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.