You are not logged in Log in Join
You are here: Home » Members » howardhansen » Zope startup script for Debian Linux

Log in
Name

Password

 

Zope startup script for Debian Linux

Zope startup script for Debian Linux

If you install Zope using a packaged build, it will create its own startup script, using /sbin/zope/zopectl. In the case where you install from source, you'll need to provide your own startup script. Here's one that's worked for me, I slightly modified it from an example provided by Oleg Broytmann phd@phd.pp.ru, one of the princes of the Zope mailing list.


#! /bin/sh

zopedir=/usr/local/Zope
PATH=.:$PATH

case "$1" in
  start)
    echo -n "Starting zope daemon: zope"
    cd $zopedir
    $zopedir/start >var/error.log 2>&1 &
    echo "."
    ;;

  stop)
    echo -n "Stopping zope daemon: zope"
    cd $zopedir
    ./stop
    rm -f var/*.pid var/pcgi.soc
    echo "."
    ;;

  restart)
    $0 stop
    sleep 3
    $0 start
    ;;

  reload)
    $0 restart
    ;;

  force-reload)
    $0 restart
    ;;

  *)
    echo "Usage: /etc/init.d/zope {start|stop|restart|reload|force-reload}"
    exit 1
    ;;
esac

exit 0

To use this, you will have to:
  • create a file called error.log inside Zope's var directory
  • change line 3 to the actual directory you've installed Zope in

Where/How to Install

Put the script above into the file /etc/init.d/zope, then follow these other steps:

1  # cd /etc/init.d
2  # chmod 755 zope
3  # ln -s zope /etc/rc2.d/S20zope
4  # ln -s zope /etc/rc6.d/K20zope

Now Zope will start automatically at boot!

Conclusion

If the Debian distribution you're using has a Zope package (of the correct version), it will do this for you automatically. That's probably the easiest solution. Reference zope list message http://lists.zope.org/pipermail/zope/2001-November/103527.html