# Custom Linux/Solaris Zope server instance start/stop bash script. # ########## # Usage:- # Save file to: # /etc/init.d/zope # modify the PLONE_INSTANCE path as described below # # Go to the rc3 directory: # cd /etc/init.d/rc3.d # # Create a symlink to start the Zope instance at bootup: # ln -s /etc/init.d/zope S49zope ########## # # Change to installation path of zope instance PLONE_INSTANCE="/home/zope/myinstance" export PLONE_INSTANCE case "$1" in 'start') # start zope server ### debug mode - all lines with ### are commented out and run the server in debug mode ### if [ -f "$PLONE_INSTANCE"/bin/runzope ]; then if [ -f "$PLONE_INSTANCE"/bin/zopectl ]; then echo "starting Zope Server" ### "$PLONE_INSTANCE"/bin/runzope > /dev/null 2>&1 & "$PLONE_INSTANCE"/bin/zopectl start > /dev/null 2>&1 & fi ;; 'stop') # stop zope server PID=`/bin/ps -e -u 0 | /bin/fgrep python | /bin/awk '{print $1}'` if [ ! -z "$PID" ] ; then /bin/kill ${PID} > /dev/null 2>&1 fi ;; *) ### echo "usage: $PLONE_INSTANCE/bin/runzope {start|stop}" echo "usage: $PLONE_INSTANCE/bin/zope {start|stop}" ;; esac