#!/sbin/runscript # Zope rc-script for Gentoo Linux # Copyright 2002-2003 by Jason Shoemaker # Distributed under the terms of the GNU General Public License, v2 or later. # $Header: /home/cvsroot/gentoo-x86/net-zope/zope/files/2.6.4/zope.initd,v 1.1 2004/03/14 12:32:15 lanius Exp $ PIDFILE=${INSTANCE_HOME}/var/Z2.pid depend() { need net } zope_is_alive() { [ -r "${PIDFILE}" ] || return 1 PID=$(cat ${PIDFILE}) [ -d "/proc/${PID}" ] || return 1 } status() { zope_is_alive && einfo "Zope is alive" && return 0 ewarn "Zope is dead" return 1 } start() { ebegin "Starting zope" start-stop-daemon --start --quiet --exec ${INSTANCE_HOME}/bin/runzope --pidfile ${PIDFILE} > ${EVENT_LOG_FILE} 2>&1 & eend $? "Failed to start zope" } stop() { local RESULT=0 ebegin "Stopping zope" if zope_is_alive ; then start-stop-daemon --stop --quiet --pidfile ${PIDFILE} RESULT=${?} else ewarn "Zope was already dead." fi eend ${RESULT} "Failed to stop zope" }