plone / plone.recipe.zope2instance

zc.buildout recipe to setup and configure a Zope 2 instance.
https://pypi.org/project/plone.recipe.zope2instance
7 stars 23 forks source link

Build a bin/instance script that works with Zope 4 + WSGI #52

Closed davisagli closed 6 years ago

davisagli commented 6 years ago

This is a pretty big change to how plone.recipe.zope2instance handles WSGI-based instances, to make them work more similarly to ZServer-based instances. Specifically, it now generates a "bin/instance" wrapper script that uses zdaemon, with the same commands. This means it's possible to do bin/instance fg|console|debug|run|adduser|start|stop|etc just like before. For WSGI it runs the Zope2.Startup.serve module and for ZServer it runs ZServer.Zope2.Startup.run.

Admins who want to skip the zdaemon script and use a simpler WSGI deployment for actually serving the site can do that, but now they won't have to hunt for a new way to run a script, get a debug console, or reset the admin password.

The 2 big new files here were mostly copied in from other places: zopectl.py came from ZServer with a few changes to make it work in the new location. wsgischema.xml is like the one in Zope 4 but with a few additions from ZServer's zopeschema.xml to accept zdaemon-related options.

pbauer commented 6 years ago

I have no time to review this now. @tschorr can you check this? It also seems to fix #2606 which is a nice bonus.

davisagli commented 6 years ago

Thanks for taking a look @tschorr. I agree with your points and will try to work on them this week at ploneconf.

icemac commented 6 years ago

I like the idea but do not know the code enough to be able to review it deeply.

davisagli commented 6 years ago

@tschorr I merged the zopectl module into ctl and copied the tests from ZServer.