Personal tools
You are here: Home Documentation Tutorials Hosting on Mac OS X Starting Zope Automatically
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Starting Zope Automatically

Create two new files and edit one old one.

Chad Whitacre

A discussion of production Plone installations on Mac OS X
Page 5 of 10.

As expected, Apple uses a variant of the modern BSD startup system. However, instead of /usr/local/etc/rc.d/, user-defined startup scripts are located in /Library/StartupItems/. There are also other slight differences. Fortunately, I was not forced to learn these intricacies, because integrating Zope with it turned out to be fairly trivial.[6]

My strategy was to copy and paste the Apache startup folder and use that as an example:

  cp -r /System/Library/StartupItems/Apache /Library/StartupItems/Zope
  cd /Library/StartupItems/Zope
  rm -r Resources
  mv Apache Zope
  edit Zope

Edit the shell script, trimming unnecessary conditions and converting from apachectl to zopectl. I've posted mine in an appendix. Then edit StartupProperties.plist. PropertyList is an Apple-specific format that has both XML and non-XML implementations. If your system is like mine, the Apache plist will be in non-XML format. Somewhere along the line I ended up switching to XML format while trying to get things to work. In the end I don't think it matters, but my example is in XML.

The last thing you need to do is to edit /etc/hostconfig, and append the following to the end of it:

  ZOPESERVER=-YES-

I learned this critical tidbit from a random how-to on Apple.com (in the last paragraph). At first I thought the value of the Provides key in the plist file is what drives the service name in /etc/hostconfig. However, now I think that the hostconfig file provides context for the Zope startup script.[7] In any case, the files as described work for me.

After you edit these three files, bounce your server and see if Zope comes back up on reboot. If it does, then it is time to step back a bit and look at what we've done with the OS X filesystem.


Notes

[6] If you want to understand the system, as good a place to start as any is Start Me Up: Writing and Understanding OS X StartupItems from O'Reilly's Mac DevCenter. This tutorial is nearly great: he makes no mention of /etc/hostconfig, however.

[7] Incidentally, here's another place where the Darwin man pages let me down. Why no manual entry for hostconfig?

 
by Chad Whitacre last modified June 29, 2006 - 14:50 All content is copyright Plone Foundation and the individual contributors.

supervise for osx?

Posted by Christof Haemmerle at May 30, 2005 - 21:25

how can i make sure that if zope crashes or any other problem accours that zope will be restarted? on bsd i use supervise. has macosx a similar machanisme?

thanx reco

Possible/Likely Typo in Article @ /etc/hostconfig

Posted by J Kaftos at September 7, 2005 - 05:54

NB that the /etc/hostconfig line cited as: ZOPESERVE=-YES- should probably be: ZOPESERVER=-YES-

Not that I have gotten it to work that way either...

-JK

and in leopard?

Posted by Shaun Roe at February 11, 2008 - 19:55
UNfortunately, I don't find /System/Library/StartupItems/Apache in leopard. What now?

Successfully started Plone on Mac OS X Leopard

Posted by Shaun Roe at February 13, 2008 - 14:31
I had to make some changes: I copied your example script, but the path to the executable was different (having used the mac installer), so the path was not /usr/local/zope/instance/bin/zopectl , but
/Applications/Plone-3.0.5/Instance/bin/zopectl
Having put this script (called 'Zope') in a newly created /Library/StartupItems/Zope I had to change its permissions:
cd /Library/StartupItems/Zope
chmod a+x Zope
Your plist went in the same place, as you instructed, and the /etc/hostconfig edited as you indicated ... et voila!
One extra touch I had to make because I use port 8080, I edited /Applications/Plone-3.0.5/Instance/etc/zope.conf to give me another port.


For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by