zope2instance fails to run as Windows Service under Python 2.6 and Zope 2.12

Bug #596839 reported by harish bansal
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
collective.buildout
Confirmed
Undecided
Unassigned

Bug Description

I am using Zope 2.12.7 and zope2instance version 4.0b1

starting zopectl>start fails with following error message

Zope434050762 (Zope instance at C:\c3_21June\parts\inst1): Process terminated with exit code 2.
C:\Python26\python.exe: can't open file 'C:\c3_21June\bin\inst1-script.exe': [Errno 2] No such file or directory

Revision history for this message
Jim Pharis (binbrain) wrote :

So I don't get this error but in a Windows env w/same versions of Zope and zope2instance after running zopectl> install and then zopectl> start I try a zopectl> status and see that pid=-1 and that no pid file was created. If I run in fg the pid file is created and I even get a ZMI. Trying windebug however I get a similar error.

"...can't open file 'client-script.exe': [Errno 2] No such file or directory". The exe created was actually client.exe. The python script created is client-script.py.

Revision history for this message
Baiju Muthukadan (baijum) wrote :

I am able to reproduce this issue in my Windows XP system.

Changed in collective.buildout:
status: New → Confirmed
Revision history for this message
Jim Pharis (binbrain) wrote :

The new plone.recipe.zope2instance will now properly install and stay started as a windows service in XP. However, there is still a problem though.

"C:\Python26\python.exe" "C:\Zope\test.buildout\bin\inst1-script.exe" console -C "C:\Zope\test.buildout\parts\inst1\etc\zope.conf"

Should be instead

"C:\Python26\python.exe" "C:\Zope\test.buildout\bin\inst1-script.py" console -C "C:\Zope\test.buildout\parts\inst1\etc\zope.conf"

When you change 'exe' to 'py' the Windows service works.

Revision history for this message
Jim Pharis (binbrain) wrote :

I should clarify that the above edit was performed on the command key in regedit.

Revision history for this message
Jim Pharis (binbrain) wrote :

No, I'm still having trouble running as a Windows service. After the above edit I can run c:\python26\lib\site-packages\win32\pythonservice.exe -debug Zope-<id> and the installed service runs fine. The service doesn't however correctly run when start directly from Windows services like I had said above.

Revision history for this message
harish bansal (harish-bansal) wrote :

plone.recipe.zope2instance 4.0.1 works for me. It stays started as windows service.
However you do need to change command key value in regedit.

Revision history for this message
kleist (kleist) wrote :

This bug is fixed in plone.recipe.zope2instance 4.0.2, which will be part of Plone 4.0 rc1 (which should be released any hour now).

Revision history for this message
harish bansal (harish-bansal) wrote :

plone.recipe.zope2instance 4.0.2 does get started as windows service. However there is still a problem:

Sometimes on stopping service as
zopectl>stop
doesn't clear up instance.pid and instance.lock files, due to which subsequent
zopectl>start
fails to start the service again and it has to be run again.

Revision history for this message
kleist (kleist) wrote :

Sometimes one can simply remove these files before starting the instance again. But sometimes the .lock file is locked by a hanging Python process, and can't be deleted. While we are trying to spot and squash the bug causing this, here is a tip:

* Install the command line utility "handle" http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx

* As Administrator, run "handle instance.lock", the pid of the hanging Python process will be printed

* From PowerShell: "kill <pid>" (e.g. "kill 12345")

This issue is also tracked by http://dev.plone.org/plone/ticket/10441

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.