This post belongs also to the "lessons learned" category.
With Plone 3, ZEO and supervisor combination you've probably configured your supervisor to start plone instances by running $BUILDOUT/parts/client1/bin/runzope.
Problem is that with Plone 4 your $BUILDOUT/parts/client folder doesn't contain anything else than etc folder. You know starting instances by targeting supervisor to use $BUILDOUT/bin/client1 fg doesn't work like you'd expect (supervisor would control the client1 script - not the actual plone process).
My colleague Jussi Talaskivi figured that using 'console' argument instead of 'fg' for bin/client1 script should do the trick. With 'console' argument stopping, starting and restarting Plone 4 instances with supervisor works like a charm.
Below is full example of working supervisor configuration.
With Plone 3, ZEO and supervisor combination you've probably configured your supervisor to start plone instances by running $BUILDOUT/parts/client1/bin/runzope.
Problem is that with Plone 4 your $BUILDOUT/parts/client folder doesn't contain anything else than etc folder. You know starting instances by targeting supervisor to use $BUILDOUT/bin/client1 fg doesn't work like you'd expect (supervisor would control the client1 script - not the actual plone process).
My colleague Jussi Talaskivi figured that using 'console' argument instead of 'fg' for bin/client1 script should do the trick. With 'console' argument stopping, starting and restarting Plone 4 instances with supervisor works like a charm.
Below is full example of working supervisor configuration.
[buildout] parts = supervisor [supervisor] recipe = collective.recipe.supervisor port = 8200 user = xxxx password = xxxx programs = 10 zeo /buildout/xxx/parts/zeoserver/bin/runzeo true zope 20 instance1 /buildout/xxx/bin/instance1 [console] true zope 20 instance2 /buildout/xxx/bin/instance2 [console] true zope
The "bin/instance console" argument has been available for years and works just as well in Plone 3.
ReplyDeleteI'd also run zeo with "bin/zeo fg" instead which also works with supervisord.
Yeah, starting instances with console argument isn't a new thing. Still several forum discussions and blog posts about Plone and supervisor mention that supervisor should launch plone instances using $BUILDOUT/parts/client/bin/runzope so that supervisor would actually control the process.
ReplyDeleteAs this is not possible with Plone 4 I tried to search alternative way. After wasting few hours by googling and asking this from #plone irc channel I was still without solution (except starting instances with fg argument which isn't the correct way as far as I know). Hopefully this post can help others looking for the same information.
About zeo.. I thought that same limitations affects to zeo too, but I guess I was wrong. I just tested and can confirm that controlling zeo with fg argument works fine with supervisor.
I'm running plone 4 instance w/o ZEO setup. And 'fg' as well as 'console' commands work well with supervisor only to start instance and to get it's status.
ReplyDeleteBut anyway supervisor is still controlling only script process, not instance process itself, that's why I can't make supervisor stop my plone 4 instance. Any suggestions?
After more experiments with 'console' command I realized that it really works. Disregard my previous comment. Thank you for sharing this information, it was really helpful!
ReplyDeleteYes, of course we know that the "console" argument has always been around, but this is still exactly what I needed to know. Thanks Jussi and Jukka.
ReplyDelete