[ZODB-Dev] ZEO question

Craig Dunigan Craig Dunigan <craig.dunigan@esker.com>
Fri, 23 Mar 2001 08:49:51 -0600 (CST)


There are two lines in start.py that I simply commented out, and my ZEO
server on NT4 runs fine.

They were:

signal.signal(signal.SIGHUP, handler)

and

open(zeo-pid, 'w').write("%s %s" % (os.getppid(), os.getpid()))

The first is presumably because NT doesn't understand SIGHUP, although I
wouldn't know what the Windows alternative would be.  The second makes
less sense, since one would think the Python os module would know the
difference between Unix-ish OSes and Windows, but it still fails for me
under ActivePython, most recent version (as of two months ago, which not
coincidentally is how long ZEO has been running without a hiccup).  

Hooray!  I can finally answer a zope question and be reasonably sure my
answer will work!  Do I get a medal, or at least a cookie or something?
;)

Craig

PS To Jim -- I'm still waiting for the posting of your excellent review at
the Python conference of the zope debugger (nudge, nudge...)


On Fri, 23 Mar 2001, Jim Fulton wrote:

> Chris Withers wrote:
> > 
> > Now on the right list, I hope :-)
> > 
> > Here's my setup:
> > 
> > -WinNT 4.0
> > -Zope 2.3.1b1
> > -ZEO 0.4.1
> > 
> > But I get this:
> > 
> > E:\Zope\2.3.1b1>python lib/python/ZEO/start.py -p 8000
> > Traceback (innermost last):
> >   File "lib/python/ZEO/start.py", line 315, in ?
> >     if __name__=='__main__': main(sys.argv)
> >   File "lib/python/ZEO/start.py", line 297, in main
> >     signal.signal(signal.SIGHUP, handler)
> > AttributeError: SIGHUP
> > 
> > What does that mean and how can I fix it?
> 
> It means you aren't running Unix/Linux aznd it means that I 
> forgot to change a finally to an except.
> 
> Actually, I'm surprised you got this far into the signal handling
> setup code.  Is there a way to send signals on windows? There must
> be I suppose. This code is there to get ZEO to shutdown gracefully
> when killed via a signal (unix kill command).
> 
> You could change the finally on the next line to an except.
> If there *is* a way to send a signal to shutdown a process
> under windows, then it might make sense to catch and ignore the SIGHUP
> setup.
> 
> OTOH, someone should probably turn the ZEO server into an NT service.
> 
> > Also, how can I get the storage server to use the Data.fs from my
> > INSTANCE_HOME rather than the SOFTWARE_HOME, which I presume the above does?
> 
> It guesses that INSTANCE_HOME is four directories above the script. (SOFTWARE_HOME
> is typically only two directories up.) You can set the INSTANCE_HOME environment
> variable to specify a specific directory. You can also provide 
> "INSTANCE_HOME=somedir" as a command-line option.
> 
> Jim
> 
> --
> Jim Fulton           mailto:jim@digicool.com   Python Powered!        
> Technical Director   (888) 344-4332            http://www.python.org  
> Digital Creations    http://www.digicool.com   http://www.zope.org
> 
> _______________________________________________
> Bug reports, feature requests, etc. go in the ZEO Tracker:
> http://www.zope.org/Products/ZEO/Tracker
> 
> Conversations etc. can take place in the Wiki:
> http://www.zope.org/Products/ZEO/Wiki
> 
> ZODB-Dev mailing list  -  ZODB-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zodb-dev
> 

Craig Dunigan
Web Programmer
Esker Software - Extending the Reach of Information
mailto://craig.dunigan@esker.com
tel 608.273.6000 ext.362
fax 608.273.8227
http://www.esker.com