Skip to content. | Skip to navigation

Sections
Personal tools
What is this?
Hi, my name is Tom Lazar and I'm a Plone and Zope developer based in Berlin, Germany and this is my personal and professional (no big difference, really...) website.
 

Autostart Zope on Ubuntu

Filed Under:

From the Looking-over-the-Fence Department

As part of a current gig I today had to set up two spanking new Ubuntu based servers and deploy a Plone application that I've developed. One task was to have the Plone application start up automatically at boot time. Being a FreeBSD person I had to adapt a bit. In the end I just mashed this init.d how-to with my own homegrown FreeBSD rc.d script and created the following shell script in /etc/init.d/zope.sh:

#!/bin/bash
INSTANCESDIR="/opt/zope/instances"
SUDO=`which sudo`
for instance in `ls $INSTANCESDIR/` ; do
  $SUDO -u www-data $INSTANCESDIR/$instance/bin/zeoserver "$@"
  sleep 5
  $SUDO -u www-data $INSTANCESDIR/$instance/bin/deployment "$@"
done

and issued the following two commands (as root):

update-rc.d zope.sh defaults
chmod a+x /etc/init.d/zope.sh

This ensures that all zope instances in $INSTANCESDIR get started at boot time (and properly shut down at shutdown time!) As you can see, I run a ZEO based setup with a deployment buildout, so, as usual, your mileage may vary etc.