[ZCM] [ZC] 1533/10 Comment "Windows Service tweaks"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Thu Apr 14 03:21:15 EDT 2005


Issue #1533 Update (Comment) "Windows Service tweaks"
 Status Pending, Zope/feature+solution medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1533

==============================================================
= Comment - Entry #10 by mhammond on Apr 14, 2005 3:21 am

All checked in - this is now resolved.
________________________________________
= Comment - Entry #9 by dreamcatcher on Mar 17, 2005 8:19 am


Uploaded:  "services4.patch"
 - http://www.zope.org/Collectors/Zope/1533/services4.patch/view
Updated patch against trunk. Not checking it in because seems to require tweaks on WinBuilders as per issue #1528.
________________________________________
= Comment - Entry #8 by mhammond on Mar 16, 2005 11:49 pm


Uploaded:  "services3.patch"
 - http://www.zope.org/Collectors/Zope/1533/services3.patch/view
Attaching a new patch against current 2.7 CVS.  In the last few checkins, the insertion of SOFTWARE_HOME into sys.path was removed - this is necessary for users which do not have SOFTWARE_HOME in their global PYTHONPATH, so the service process itself can locate the Zope service utilities (ie, setting PYTHONPATH helps only the service child process, not the service process itself)

>From the discussions in December on zope-dev, this is a little more careful about sys.path/PYTHONPATH insertions - in both cases we do a simple check that SOFTWARE_HOME is not already there.

This does run the risk that an unintentionally bad PYTHONPATH will prevent the service running (eg, consider a different Zope instance being on the path before ours).  The benefit is that a user can carefully hand-craft a PYTHONPATH variable (eg, to override certain Zope modules with their own), and we will honour it.

________________________________________
= Comment - Entry #7 by tim_one on Dec 30, 2004 12:42 am

`patch` is a standard utility program on all Unixish systems.  It takes a source file and applies "a patch" to it (like Mark's .patch files), yielding a new version of the source file.  A "patch file" is pretty much just the output of the standard `diff` utility, recording the differences between two versions of a file.  The source-control system CVS, for example, applies patches in this way whenever you do "cvs update".

Most implementations of `patch` for Windows are broken, in gross or subtle ways.  The Cygwin version of `patch` can be recommended.
________________________________________
= Comment - Entry #6 by finrod on Dec 29, 2004 10:10 pm

I guess I'm just going to appear like a dope, but here goes. What is  "patch"? I've looked all through the docs and the "how-tos" but have not found an explanatrion for how to apply one of these patches. 

I looked in the 2.7 CVS branch, but was unable to find the file. I was looking here: http://cvs.zope.org/Zope/lib/python/nt_svcutils/Attic/, but this did not seem to be the correct version.

I did donwnload the "service2.patch from the collector, but am unsure what exactly to do with it. I'll admit I'm a newby to Zope and Plone, but am a fairly clued in IT guy and programmer. Fairly new to Python and Zope tho...but quite interested for sure. 
________________________________________
= Comment - Entry #5 by mhammond on Dec 29, 2004 7:55 pm

This issue, and those mentioned in Tim's entry #3, all have .patch files attached.  These should be applied using 'patch' to the Zope 2.7 CVS branch.  Let me know if the branch moves such that they no longer apply, or if a branch against the svn trunk is required.
________________________________________
= Comment - Entry #4 by finrod on Dec 29, 2004 5:51 pm

ok - I'm probably opening up a serious flame here, but how exactly does one install this patch?
________________________________________
= Comment - Entry #3 by tim_one on Dec 17, 2004 2:32 pm

Looks like the prerequisite patches are specifically those in Collector items 1527 and 1528.  Not sure whether 1531 is necessary too, but offhand doubt it.
________________________________________
= Comment - Entry #2 by mhammond on Nov 23, 2004 7:08 pm


Uploaded:  "service.2.patch"
 - http://www.zope.org/Collectors/Zope/1533/service.2.patch/view
An updated patch: keeps the "lower()" on the instance name, and removes a bogus 'import win32traceutil'
________________________________________
= Request - Entry #1 by mhammond on Oct 13, 2004 1:11 am


Uploaded:  "services.patch"
 - http://www.zope.org/Collectors/Zope/1533/services.patch/view
Attached is a patch for more reliable Windows services, as discussed on zope-dev some time ago:

* The Zope child process output is collected reliably.  If the process dies with a non-zero exit code, the last ~2k of child output is written to the Windows event log.

* Requesting a shutdown during the back-off period is reflected immediately rather than waiting for the timeout

* Stopping the service no longer terminates the child process - it arranges for graceful shutdown.  It still terminates if the child refuses

* Changes to the service skeleton to support the new service code.

As agreed on zope-dev, there is no change to the backoff strategy - if Zope has a fatal startup error, it will continue to restart as previously.

Before starting the patch, I copied the trunk's service.py as it was in better starting shape.  This means the patched file is also suitable for 2.8 (but the patch probably won't apply there)

This is likely to be the last of this round of patches, and depends on most of my recent previous ones.  Notably the 'clean shutdown' patch, and 'WinBuilders' as this requires pywin32-203 or later.
==============================================================



More information about the Zope-Collector-Monitor mailing list