summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-www/zope/files')
-rw-r--r--net-www/zope/files/digest-zope-2.4.01
-rw-r--r--net-www/zope/files/zope167
2 files changed, 168 insertions, 0 deletions
diff --git a/net-www/zope/files/digest-zope-2.4.0 b/net-www/zope/files/digest-zope-2.4.0
new file mode 100644
index 000000000000..88acd9059751
--- /dev/null
+++ b/net-www/zope/files/digest-zope-2.4.0
@@ -0,0 +1 @@
+MD5 1a41e096a80411bccf61cd862bc3cc20 Zope-2.4.0-src.tgz
diff --git a/net-www/zope/files/zope b/net-www/zope/files/zope
new file mode 100644
index 000000000000..b84f1eae3eea
--- /dev/null
+++ b/net-www/zope/files/zope
@@ -0,0 +1,167 @@
+#!/bin/sh
+# Copyright (c) 1995-1998 SuSE GmbH Nuernberg, Germany.
+#
+# Author: Vojtech Bubnik <bubnikv@suse.cz>
+# Based on script from: Jeff Rush <jrush@taupro.com>
+# modified for gentoo linux by Holger Brueckner <darks@gentoo.org>
+#RCUPDATE:3 4:99
+
+. /etc/rc.d/config/functions
+
+SERVICE=zope
+opts="start stop restart status"
+
+export INSTANCE_HOME=/var/lib/zope
+export INSTANCE_NAME=`basename ${INSTANCE_HOME}`
+
+ZOPE_PCGI="no"
+
+# Logging to a remote server using syslogd can
+# be done by using ZSYSLOG_SERVER instead if ZYSLOG. If you do not define
+# either of the ZSYSLOG* env vars, logging goes to the file specified by
+# the -l <file> command argument instead.
+
+# Note: For syslog logging to work from the ZServer/medusa subsystem, the
+# ZSYSLOG variable must now contain the name of the socket to log to,
+# usually /dev/log on Unix machines.
+
+#export ZSYSLOG="/dev/log"
+#export ZSYSLOG_SERVER="localhost:514"
+
+start_zope() {
+ (
+ cd ${INSTANCE_HOME}
+ if [ $ZOPE_PCGI = "yes" ] ; then
+ /usr/bin/env python z2.py \
+ -p $INSTANCE_HOME/Zope.cgi \
+ -u root \
+ -z /usr/share/zope \
+ -Z /var/run/zwatchdog.pid \
+ -w '' \
+ -f 8021 \
+ -m '' \
+ -l /var/log/zope \
+ 2>&1 >> /var/log/zope \
+ &
+ else
+ /usr/bin/env python z2.py \
+ -u root \
+ -z /usr/share/zope \
+ -Z /var/run/zwatchdog.pid \
+ -w 8080 \
+ -f 8021 \
+ -W 8023 \
+ -m '' \
+ -l /var/log/zope \
+ -D \
+ 2>&1 >> /var/log/zope \
+ &
+ fi
+ )
+}
+
+# A function to find the pid of a program. We cannot use checkproc,
+# because we are handling scripts.
+pidofproc() {
+ # First try the "$INSTANCE_HOME/var/Z2.pid" file
+ if [ -f ${INSTANCE_HOME}/var/Z2.pid ] ; then
+ if [ "$1" = "zwatchdog" ] ; then
+ pid=`sed -e 's/^\([0-9]\+\) [0-9]\+/\1/' ${INSTANCE_HOME}/var/Z2.pid`
+ else
+ if [ "$1" = "zserver" ] ; then
+ pid=`sed -e 's/^[0-9]\+ \([0-9]\+\)/\1/' ${INSTANCE_HOME}/var/Z2.pid`
+ fi
+ fi
+
+ if [ "$pid" != "" ] ; then
+ echo $pid
+ return 0
+ fi
+ fi
+
+ # Next try "/var/run/*.pid" files
+ if [ -f /var/run/$1.pid ] ; then
+ pid=`head -1 /var/run/$1.pid`
+ if [ "$pid" != "" ] ; then
+ echo $pid
+ return 0
+ fi
+ fi
+
+ # Next try "pidof"
+ pid=`pidof -o $$ -o $PPID -o %PPID -x $1`
+ if [ "$pid" != "" ] ; then
+ echo $pid
+ return 0
+ fi
+}
+
+# Extracted from 'functions' to fix a tiny bug where it uses 'pidof'
+# but should be using 'pidofproc'.
+chkstatus() {
+ # First try "pidofproc"
+ pid=`pidofproc $1`
+ if [ "$pid" != "" ] && ps h $pid >/dev/null 2>&1 ; then
+ echo "$1 (pid $pid) is running..."
+ return 0
+ else
+ pid=`pidof -o $$ -o $PPID -o %PPID -x $1`
+ if [ "$pid" != "" ] ; then
+ echo "$1 (pid $pid) is running..."
+ return 0
+ fi
+ fi
+
+ # Next try "/var/run/*.pid" files
+ if [ -f /var/run/$1.pid ] ; then
+ pid=`head -1 /var/run/$1.pid`
+ if [ "$pid" != "" ] ; then
+ echo "$1 dead but pid file exists"
+ return 1
+ fi
+ fi
+
+ # See if /var/lock/subsys/$1 exists
+ if [ -f /var/lock/subsys/$1 ]; then
+ echo "$1 dead but subsys locked"
+ return 2
+ fi
+ echo "$1 is stopped"
+ return 3
+}
+
+start() {
+ ebegin "Starting zope"
+ # See if it's already running.
+ zw_pid=`pidofproc zwatchdog`
+ zs_pid=`pidofproc zserver`
+ if ( [ -z "$zw_pid" ] || ! ps h $zw_pid >/dev/null 2>&1 ) && \
+ ( [ -z "$zs_pid" ] || ! ps h $zs_pid >/dev/null 2>&1 ) ; then
+ rm -f ${INSTANCE_HOME}/var/Z2.pid
+ start_zope
+ ret=$?
+ fi
+ eend $ret "Error starting $SERVICE"
+ }
+stop(){
+ ebegin "Shutting down zope"
+ pid=`pidofproc zwatchdog`
+ [ -n "$pid" ] && (kill $pid 2>&1 >/dev/null)
+ pid=`pidofproc zserver`
+ [ -n "$pid" ] && (kill $pid 2>&1 >/dev/null)
+ rm -f ${INSTANCE_HOME}/var/Z2.pid /var/run/zwatchdog.pid
+ eend $? "Error stopping $SERVICE"
+ }
+
+restart(){
+ stop
+ start
+ }
+
+status(){
+ echo "Checking for zope: "
+ chkstatus zwatchdog
+ chkstatus zserver
+ }
+
+doservice ${@}