Running Zope3 as daemon service

The first Zope3 site I built a few months ago is still running on our development server. Which was a decision. We did not want to experiment with this new technique on a server also serving customer sites.

To be honest. I also did not get to installing Zope3 in such a way that it would fire up my z3 application when the server is restarted. Until yesterday, everytime the server was rebooted—not too uncommon for a development server—I had to restart my Zope application manually.

How nice would it be to be able to just reboot without bothering about restarting my Zope application. And eventually I should get this site onto one of our production servers of course.

Anyway, my Linux skills do not go far beyond ‘user’ level. With the difference that I have ‘root’ access. A dangerous combination🙂

After some searching (thanks fromdownunder) I succeeded.

Assuming you have

  • RedHat Linux Fedora Core3
  • a Zope3 instance installed that you can start manually

Here’s the How-To get Zope3 running as a Linux daemon service.

  1. Change to root with
    su
  2. Copy <your z3 instance path>/bin/zopectl to /etc/init.d/zope3ctl
  3. Edit /etc/init.d/zope3ctl to include (new: lines 2-3)
    #!/usr/bin/python
    # chkconfig: 345 30 70
    # description: Zope - My installation
  4. Then run from the command line
    /sbin/chkconfig --add zope3ctl
    and
    /sbin/service zope3ctl start

If all went well, you should read something about a process having been started.

You can check if your zope3ctl was added to the services list, run
/sbin/chkconfig --list zope3ctl

Comments are welcome.

One Response to “Running Zope3 as daemon service”

  1. Graham Klyne Says:

    I was very pleased to find these instructions, but they didn’t work for me.

    On running “service zope3ctl start” I get:

    Error: error opening file /etc/rc.d/etc/zdaemon.conf: [Errno 2] No such file or directory: ‘/etc/rc.d/etc/zdaemon.conf’

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: