[ZODB-Dev] ZEO and pidfiles

Alan Milligan alan at balclutha.org
Tue Jan 27 22:41:41 EST 2004


Ok.

The ZEO/start.py looks like it's been seriously bitten by tabnanny circa 
line 276 where it's supposed to write the pidfile.  This script does 
have that smell of cruft needing the old cvs remove ...

I've attached a patch to runzeo.py to write a pidfile to ZEO_SERVER_PID 
if it's defined as I believe this is consistent with past behaviour for 
this process ...

I can post a startup script for ZEO, but it's hardly rocketscience once 
there's access to a pid.

Cheers, Alan

Chris McDonough wrote:

>There is a "start.py" in the ZEO directory which looks like it tries to
>import the (ancient) zdaemon.Daemon package and writes a pid file and
>all that jazz, but I'm not sure under what circumstance (if any) it's
>supposed to be used.
>
>If that's not used (there is also a "runzeo.py" script which is I think
>is what zdctl calls), ZEO doesn't write a pidfile nor does
>zeoctl/zdctl.  ZEO should likely be responsible for writing a pidfile. 
>This follows Zope's pattern and would allow rc script writers to do what
>Alan says.  It looks like runzeo already handles signals, so sending the
>child process a signal should (ha ha) do the right thing.
>
>- C
>
>
>On Tue, 2004-01-27 at 20:05, Alan Milligan wrote:
>  
>
>>Hi,
>>
>>I've seen a posting on gmane suggesting that one must grop for a ZEO pid 
>>using zdctl.
>>
>>Is this true?
>>
>>There seems to be some code in ZEO.utils.Environment which suggests 
>>setting ZEO_SERVER_PID will write to that file.  This unfortunately 
>>doesn't work for me :(
>>
>>I'd really like to see a pid file - even a stale one.  
>>/etc/rc.d/init.d/functions provides a range of useful functions to deal 
>>with these contingencies when writing a startup script.
>>
>>TIA
>>Alan
>>
>>
>>_______________________________________________
>>For more information about ZODB, see the ZODB Wiki:
>>http://www.zope.org/Wikis/ZODB/
>>
>>ZODB-Dev mailing list  -  ZODB-Dev at zope.org
>>http://mail.zope.org/mailman/listinfo/zodb-dev
>>    
>>
>
>  
>
-------------- next part --------------
--- runzeo.py	2004-01-28 14:07:58.000000000 +1100
+++ runzeo.py.old	2004-01-28 13:50:24.000000000 +1100
@@ -121,12 +121,6 @@
             self.open_storages()
             self.setup_signals()
             self.create_server()
-	    try:
-	        f = open(os.getenv("ZEO_SERVER_PID"), 'w')
-	        f.write("%s" % os.getpid())
-	        f.close()
-	    except:
-		pass
             self.loop_forever()
         finally:
             self.close_storages()


More information about the ZODB-Dev mailing list