[ZCM] [ZC] 1438/ 7 Comment "Zope Does Not Install as Windows Service"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Wed Dec 29 09:05:18 EST 2004


Issue #1438 Update (Comment) "Zope Does Not Install as Windows Service"
 Status Resolved, Zope/bug medium
To followup, visit:
  http://zope.org/Collectors/Zope/1438

==============================================================
= Comment - Entry #7 by finrod on Dec 29, 2004 9:05 am

I did some follow-up poking around. I figured out how to get my service to try to startup in debug mode. This is the console output:

C:\Zope-Instance\bin>"c:\Zope\bin\python.exe" zopeservice.py debug
Debugging service Zope_-1444516661 - press Ctrl+C to stop.
Info 0x40001002 - The Zope_-1444516661 service has started (Zope instance at C:\
Zope-Instance).
Warning 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): proce
ss died unexpectedly.  Will attempt restart after 5 seconds.
Info 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): recoveri
ng from died process, new process started
Warning 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): proce
ss died unexpectedly.  Will attempt restart after 10 seconds.
Info 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): recoveri
ng from died process, new process started
Warning 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): proce
ss died unexpectedly.  Will attempt restart after 20 seconds.
Info 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): recoveri
ng from died process, new process started
Warning 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): proce
ss died unexpectedly.  Will attempt restart after 40 seconds.
Info 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): recoveri
ng from died process, new process started
Warning 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): proce
ss died unexpectedly.  Will attempt restart after 80 seconds.
Info 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): recoveri
ng from died process, new process started
Warning 0x400000FF - Zope_-1444516661 (Zope instance at C:\Zope-Instance): proce
ss died unexpectedly.  Will attempt restart after 160 seconds.
Stopping debug service.
Error 0xC0000003 - The instance's SvcRun() method failed

  File "C:\Zope\bin\Lib\site-packages\win32serviceutil.py", line 670, in SvcRun
    self.SvcDoRun()
  File "C:\Zope\lib\python\nt_svcutils\service.py", line 163, in SvcDoRun
    time.sleep(backoff_interval)

exceptions.IOError: (4, 'Interrupted function call')

C:\Zope-Instance\bin>

The error at the end was due to my CTRL-C.

I then found under the Zope-Instance directories some test.py scripts. I ran them all...two were successful (test_schema.py and and test_warnfilter.py) the third testStarter.py failed. Here is the error I got:

C:\Zope-Instance\bin>c:\zope\bin\python.exe c:\zope\lib\python\Zope\startup\test
s\testStarter.py
c:\zope\bin\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is deprecated;
please use fcntl
  DeprecationWarning)
.E.......
======================================================================
ERROR: testMakeLockFile (__main__.ZopeStarterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\zope\lib\python\Zope\startup\tests\testStarter.py", line 313, in test
MakeLockFile
    starter.makeLockFile()
  File "C:\Zope\lib\python\Zope\Startup\__init__.py", line 251, in makeLockFile
    lock_file(self.lockfile)
  File "C:\Zope\lib\python\Zope\Startup\misc\lock_file.py", line 40, in lock_fil
e
    fcntl.flock(file, fcntl.LOCK_EX | fcntl.LOCK_NB)
AttributeError: 'module' object has no attribute 'flock'

----------------------------------------------------------------------
Ran 9 tests in 3.855s

FAILED (errors=1)

C:\Zope-Instance\bin>
________________________________________
= Comment - Entry #6 by ctheune on Oct 14, 2004 5:34 pm

Can you check that with 2.7.3-beta2 please? 2.7.3 is going to be out _soon_, this is your chance. :)
________________________________________
= Comment - Entry #5 by wmcrogers on Oct 13, 2004 9:58 pm

I've installed Zope 2.7.2-0, and corrected zopeservice.py script as suggested.  However when starting the service it dies repeatedly.
 From the EventViewer:
 Error: 255
 Message: Zope_-1444516661 (Zope instance at C:\Zope-Instance): process died
    unexpectedly.  Will attempt restart after 10 seconds.

As also suggested in the zopeservice.py script, I tried to register PythonService.exe, but also received error messages:

>"C:\Program Files\Zope-2.7.2-0\bin\PythonService.exe" /register

 Registering the Python Service Manager...
 Fatal Python error: PyThreadState_Get: no current thread

 This application has requested the Runtime to terminate it in an unusual way.
 Please contact the application's support team for more information.

I'm running XP Pro SP2.  Any suggestions
________________________________________
= Resolve - Entry #4 by tim_one on Jul 29, 2004 11:34 am

 Status: Pending => Resolved

This is how to install the service manually:  open a DOS box, cd to the bin directory of your instance, and use your Zope's Python (wherever you installed that) to run this:

C:\Zope-Instance\bin>"\Program Files\Zope-2.7.2-0\bin\python.exe" zopeservice.py --startup auto install

In the distributed 2.7.2, that fails, like this:

Traceback (most recent call last):
  File "zopeservice.py", line 102, in ?
    servicename = 'Zope_%s' % str(hash(INSTANCE__HOME.lower()))
NameError: name 'INSTANCE__HOME' is not defined

That's been fixed in CVS, so I'm closing this report.  If you want to, you can fix it yourself in your 2.7.2 by editing zopeservice.py and removing one of the underscores in INSTANCE__HOME (on line 102, as the traceback above shows).  It should have been INSTANCE_HOME, with just one underscore.

Then the manual install should work:

C:\Zope-Instance\bin>"\Program Files\Zope-2.7.2-0\bin\python.exe" zopeservice.py --startup auto install
Installing service Zope_-1444516661 to Python class C:\Zope-Instance\bin\zopeservice.InstanceService
Service installed

After that, you can go to the Services GUI to start the service by clicking stuff, or you can start it from the command line:

C:\Zope-Instance\bin>"\Program Files\Zope-2.7.2-0\bin\python.exe" zopeservice.py  start
Starting service Zope_-1444516661

The above was all run on a WinXP Pro SP1 box.
________________________________________
= Comment - Entry #3 by Les on Jul 29, 2004 5:53 am

Zope-2.7.2-0-win32.exe  installed on win2k, after removing previous installation; Zope-2.7.0-win32.exe.

I checked the option to run as a service, but Zope was not registered as a service by the installer.

Running:  pythonservice.exe /register
Gives me:

  Registering the Python Service Manager...
  Fatal Python error: PyThreadState_Get: no current thread
  abnormal program termination


________________________________________
= Comment - Entry #2 by ajung on Jul 28, 2004 2:38 am

Since you did not provide any useful informations it is hard to determine what your problem might be.

Despite the lack of information you provide there is one hint: zopeservice.py has been fixed latetly.

See http://collector.zope.org/Zope/1435
________________________________________
= Request - Entry #1 by Anonymous User on Jul 27, 2004 10:53 am

I have installed Zope on two Windows XP Professional machines.  In both cases during the install I checked the box to install Zope as a service.  In both cases Zope failed to install as a Windows Service.
==============================================================



More information about the Zope-Collector-Monitor mailing list