+++ /dev/null
---- Zope-2.6.2b5-src.orig/lib/python/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py 2002-08-14 18:25:12.000000000 -0400
-+++ Zope-2.6.2b5-src/lib/python/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py 2003-02-27 16:26:02.000000000 -0500
-@@ -45,7 +45,7 @@
- phys_path = ob.getPhysicalPath()
- if self.hit_counts.has_key(phys_path):
- del self.hit_counts[phys_path]
-- ob_path = quote('/'.join(phys_path))
-+ ob_path = '/'+ob.absolute_url(relative=1)
- results = []
- for url in self.notify_urls:
- if not url:
-@@ -57,6 +57,8 @@
- u = 'http://' + url
- (scheme, host, path, params, query, fragment
- ) = urlparse.urlparse(u)
-+ if path[:8].lower() == '/http://':
-+ path = path[1:]
- if path[-1:] == '/':
- p = path[:-1] + ob_path
- else:
-@@ -67,6 +69,12 @@
- errcode, errmsg, headers = h.getreply()
- h.getfile().read() # Mandatory for httplib?
- results.append('%s %s' % (errcode, errmsg))
-+ if p[-11:]=='/index_html':
-+ h.putrequest('PURGE',p[:-10])
-+ h.endheaders()
-+ errcode, errmsg, headers = h.getreply()
-+ h.getfile().read() # Mandatory for httplib?
-+ results.append('%s %s' % (errcode, errmsg))
- return 'Server response(s): ' + ';'.join(results)
-
- def ZCache_get(self, ob, view_name, keywords, mtime_func, default):
--- /dev/null
+diff -durN Zope-2.7.0-b2.orig/configure Zope-2.7.0-b2/configure
+--- Zope-2.7.0-b2.orig/configure Fri Aug 22 16:07:55 2003
++++ Zope-2.7.0-b2/configure Wed Nov 12 17:42:58 2003
+@@ -19,7 +19,7 @@
+ # sys.version) below in "best" to "worst" order, not including the
+ # target version. Up to six acceptable python versions are allowed.
+ # Do not include the target version number in this list!
+-ACCEPTABLE="2.2.2 2.3 2.3b1 2.3a1 2.3a0"
++ACCEPTABLE="2.2.2 2.3 2.3b1 2.3a1 2.3a0 2.3.2"
+
+ # provide the executable names for all the acceptable versions
+ # (and the target version) below
+@@ -113,7 +113,8 @@
+ out ""
+ out " The optimimum Python version ($TARGET) was found at $FOUND."
+ elif [ -z "$FOUND1" ] && [ -z "$FOUND2" ] && [ -z "$FOUND3" ] &&
+- [ -z "$FOUND4" ] && [ -z "$FOUND5" ] && [ -z "$FOUND6" ] ; then
++ [ -z "$FOUND4" ] && [ -z "$FOUND5" ] && [ -z "$FOUND6" ] &&
++ [ -z "$FOUND7" ] ; then
+ out ""
+ out " No suitable Python version found. You should install"
+ out " Python version $TARGET before continuing. Versions"
+@@ -138,6 +139,9 @@
+ elif [ -n "$FOUND6" ]; then
+ FOUND=$FOUND6
+ FOUNDVERSION=$FOUNDVERSION6
++ elif [ -n "$FOUND7" ]; then
++ FOUND=$FOUND7
++ FOUNDVERSION=$FOUNDVERSION7
+ fi
+ out ""
+ out " !! WARNING !! "
+++ /dev/null
-#! /bin/sh
-
-# This is Zope ZServer startscript for PLD Linux
-#
-
-ZOPE_BASE=/usr/lib/zope
-CLIENT_HOME=$INSTANCE_HOME/var
-
-# prepare directories
-
-if [ "x$ZOPE_USER" = "x" ]; then
- ZOPE_USER="zope"
-fi
-
-ZOPE_GROUP=`id -ng $ZOPE_USER`
-
-if [ ! -d $INSTANCE_HOME ]; then
- mkdir $INSTANCE_HOME
-fi
-
-chmod 1701 $INSTANCE_HOME
-chown root:$ZOPE_GROUP $INSTANCE_HOME
-
-if [ ! -d $INSTANCE_HOME/var ]; then
- mkdir $INSTANCE_HOME/var
-fi
-
-chown root:$ZOPE_GROUP $INSTANCE_HOME/var
-chmod 1701 $INSTANCE_HOME/var
-
-if [ ! -d /var/log/zope ]; then
- mkdir /var/log/zope
- chmod o-rwx /var/log/zope
- chown root:root /var/log/zope
-fi
-
-# prepare parameters
-
-if [ "$WATCHDOG" = "0" ]; then
- manager=
-else
- manager="-Z 1"
-fi
-
-if [ "x$CGIBIN_BASE" = "x" ]; then
- p_string=" "
-else
- p_string="-p $CGIBIN_FILE"
-fi
-
-if [ "x$DEBUG_MODE" = "xyes" -o "x$DEBUG_MODE" = "x1" ]; then
- debugging="-D 1"
-else
- debugging=
-fi
-
-if [ "x$LOG_FILE" = "x" -o "x$LOG_FILE" = "x0" ]; then
- LOG_FILE=/var/log/zope/$INSTANCE_NAME.log
-fi
-
-if [ "x$DETAILED_LOG_FILE" = "x" -o "x$DETAILED_LOG_FILE" = "x0" ]; then
- details=
-else
- if [ "x$DETAILED_LOG_FILE" = "xyes" -o "x$DETAILED_LOG_FILE" = "x1" ]; then
- details="-M /var/log/zope/$INSTANCE_NAME-detailed.log"
- else
- details="-M $DETAILED_LOG_FILE"
- fi
-fi
-
-if [ "x$LOC" != "x" ]; then
- locale="-L $LOC"
-else
- locale=
-fi
-
-if [ "x$ICP_PORT" = "x" -o "x$ICP_PORT" = "x0" ]; then
- icpstr=" "
-else
- icpstr="--icp $ICP_PORT"
-fi
-
-if [ "x$IP_ADDRESS" = "x" -o "x$IP_ADDRESS" = "x0" ]; then
- ipstr=" "
-else
- ipstr="-a '$IP_ADDRESS'"
-fi
-
-# show what we're going to do
-
-if [ "x$debugging" != "x" ]; then
-cat <<EE | ( while read line; do echo "zope-start: $line"; done ) >>$LOG_FILE
-`date`
-Instance name: $INSTANCE_NAME
-Executing:
-exec python $ZOPE_BASE/z2.py
- -z $INSTANCE_HOME
- -t $NUMBER_OF_THREADS
- -u $ZOPE_USER
- -w $HTTP_PORT
- -f $FTP_PORT
- -l $LOG_FILE
- $ipstr
- $icpstr
- $manager
- $locale
- $debugging
- $p_string
- $details
->> $LOG_FILE 2>&1
-EE
-fi
-
-# call server
-
-exec python $ZOPE_BASE/z2.py \
--z "$INSTANCE_HOME" \
--t "$NUMBER_OF_THREADS" \
--u "$ZOPE_USER" \
--w "$HTTP_PORT" \
--f "$FTP_PORT" \
--W "$WEBDAV_PORT" \
--l "$LOG_FILE" \
-$ipstr \
-$icpstr \
-$manager \
-$locale \
-$debugging \
-$p_string \
-$details \
->> $LOG_FILE 2>&1 \
-&
fi
# Zope settings.
-. /etc/sysconfig/zope
+INSTANCES="main"
+[ -f /etc/sysconfig/zope ] && . /etc/sysconfig/zope
-# functions
-
-unset_vars()
-{
- unset INSTANCE_NAME INSTANCE_HOME INST_HOME CGIBIN_BASE LOG_FILE
- unset ZOPE_BASE ZOPE_USER NUMBER_OF_THREADS ZOPE_HOME
- unset IP_ADDRESS HTTP_PORT FTP_PORT WEBDAV_PORT WATCHDOG
- unset IPC_PORT LOC DEBUG_MODE DETAILED_LOG_FILE
-
- # by default disable any access
- HTTP_PORT="-"
- ICP_PORT="-"
- FTP_PORT="-"
- WEBDAV_PORT="-"
-}
-
-start_instance()
-{
- msg_starting "$z_name"
-
- INST_HOME="$INSTANCE_HOME"
- ZOPE_HOME="$INSTANCE_HOME"
-
- export INSTANCE_NAME INSTANCE_HOME INST_HOME CGIBIN_BASE LOG_FILE
- export ZOPE_BASE ZOPE_USER NUMBER_OF_THREADS ZOPE_HOME
- export IP_ADDRESS HTTP_PORT FTP_PORT WEBDAV_PORT WATCHDOG
- export IPC_PORT LOC DEBUG_MODE DETAILED_LOG_FILE
-
- daemon zope-start
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope
- sleep 5
-}
-
start_instances()
{
- for i in /etc/zope/instances/*
+ RETVAL=1
+ for INSTANCE_NAME in $INSTANCES
do
- unset_vars
- INSTANCE_NAME=`basename $i`
- echo "$INSTANCE_NAME" | egrep -q "rpmsave|rpmorig" && continue
- . $i
- PIDFILE=$INSTANCE_HOME/var/Z2.pid
- if [ "x$INSTANCE_NAME" = "xmain" ]; then
- z_name="Zope"
- else
- z_name="Zope ($INSTANCE_NAME)"
+ INSTANCE_HOME="/var/lib/zope/$INSTANCE_NAME"
+
+ if [ -f /var/lock/subsys/"zope-$INSTANCE_NAME" ]; then
+ msg_already_running "Zope instance $INSTANCE_NAME"
+ continue
fi
- if [ -f $PIDFILE ]; then
- if ps -p `cat $PIDFILE` >/dev/null; then
- RETVAL=$?
- msg_already_running "$z_name"
- continue
- else
- rm -f $PIDFILE
- fi
+
+ run_cmd "Starting Zope instance $INSTANCE_NAME" "$INSTANCE_HOME"/bin/zopectl start
+ RET=$?
+ if [ $RET -eq 0 ]; then
+ touch /var/lock/subsys/"zope-$INSTANCE_NAME"
+ RETVAL=0
fi
- start_instance
done
+ return $RETVAL
}
stop_instances()
{
- for i in /etc/zope/instances/*
+ RETVAL=1
+ for INSTANCE_NAME in $INSTANCES
do
- unset_vars
- . $i
- PIDFILE=$INSTANCE_HOME/var/Z2.pid
- INSTANCE_NAME=`basename $i`
- if [ "x$INSTANCE_NAME" = "xmain" ]; then
- z_name="Zope"
- else
- z_name="Zope ($INSTANCE_NAME)"
+ INSTANCE_HOME="/var/lib/zope/$INSTANCE_NAME"
+
+ if [ ! -f /var/lock/subsys/"zope-$INSTANCE_NAME" ]; then
+ msg_not_running "Zope instance $INSTANCE_NAME"
+ continue
fi
- if [ -f $PIDFILE ]; then
- msg_stopping "$z_name"
- busy
- kill `cat $PIDFILE` 2>/dev/null
- RET=$?
- sleep 1
- if [ $RET -eq 0 ]; then
- ok
- else
- sleep 5
- kill -9 `cat $PIDFILE` 2>/dev/null
- RET=$?
- [ $RET -eq 0 ] && ok || died
- fi
- rm -f $PIDFILE
- else
- msg_not_running "$z_name"
+ run_cmd "Stopping Zope instance $INSTANCE_NAME" "$INSTANCE_HOME"/bin/zopectl stop
+ RET=$?
+ if [ $RET -eq 0 ]; then
+ RETVAL=0
fi
+ rm -f /var/lock/subsys/"zope-$INSTANCE_NAME"
done
+ return $RETVAL
}
stat_instances()
{
- for i in /etc/zope/instances/*
+ for INSTANCE_NAME in $INSTANCES
do
- unset_vars
- . $i
+ INSTANCE_HOME=/var/lib/zope/$INSTANCE_NAME
PIDFILE=$INSTANCE_HOME/var/Z2.pid
- INSTANCE_NAME=`basename $i`
- if [ "x$INSTANCE_NAME" = "xmain" ]; then
- z_name="Zope"
- else
- z_name="Zope ($INSTANCE_NAME)"
- fi
- if [ -f $PIDFILE ]; then
- if ps -p `cat $PIDFILE` >/dev/null; then
- RETVAL=$?
- nls "%s (pid %s) is running..." "$z_name" "`cat $PIDFILE`"
- else
- nls "%s dead but pid file exists" "$z_name"
- RETVAL=1
- fi
- else
- nls "%s is stopped" "$z_name"
- RETVAL=2
- fi
+ $INSTANCE_HOME/bin/zopectl status
done
}
# See how we were called.
case "$1" in
start)
+ msg_starting "Zope"
+ started
start_instances
+ RETVAL=$?
+ if [ "$RETVAL" = 0 ] ; then
+ msg_starting "Zope"
+ ok
+ touch /var/lock/subsys/zope
+ else
+ msg_starting "Zope"
+ fail
+ fi
;;
stop)
+ if [ -f /var/lock/subsys/named ]; then
+ msg_stopping "Zope"
+ started
stop_instances
+ RETVAL=$?
+ if [ "$RETVAL" = 0 ] ; then
+ msg_stopping "Zope"
+ ok
+ else
+ msg_stopping "Zope"
+ fail
+ fi
+ rm -f /var/lock/subsys/zope >/dev/null 2>&1
+ else
+ msg_not_running "Zope"
+ exit 1
+ fi
;;
status)
- stat_instances
+ stat_instances
;;
restart|force-reload)
$0 stop
+++ /dev/null
-# This is Zope instance file for PLD Linux
-#
-# To create new instance just copy this
-# file under new name in the current directory
-# and setup options according to your needs.
-#
-# Note, that you may also use virtual hosts
-# handled just by one Zope instance.
-#
-
-# Zope database directory
-INSTANCE_HOME=/var/lib/zope/main
-
-# user to run Zope
-# note: you should create a dedicated default group
-# for this user; zope prefers group-based security
-# while accessing its log and database files
-ZOPE_USER=zope
-
-# ip address to bind to (e.g.: "127.0.0.1")
-# empty means to listen on all interfaces
-IP_ADDRESS=
-
-# ports to listen on (unset or "-" means disabled)
-HTTP_PORT=80
-FTP_PORT=21
-IPC_PORT=80
-#WEBDAV_PORT=9800
-
-# number of the initial threads to run
-NUMBER_OF_THREADS=4
-
-# cgi-bin base (empty means to not use)
-# CGIBIN_FILE=/home/services/httpd/cgi-bin/zope-main.cgi
-
-# internationalization
-# LOC='pl_PL'
-
-# shoulg we use watchdog? it restarts Zope in case of failure
-WATCHDOG=no
-
-# DEBUG_MODE
-DEBUG_MODE=0
-
-# log filename path (empty defaults to: /var/log/zope/INSTANCE_NAME.log)
-LOG_FILE=
-
-# detailed log filename path
-# (empty means no detailed logging)
-# ('yes' means /var/log/zope/INSTANCE_NAME-detailed.log)
-DETAILED_LOG_FILE=yes
-/var/log/zope/main.log {
- postrotate
- /etc/rc.d/init.d/zope reload >/dev/null 2>&1
- endscript
-}
-
-/var/log/zope/main-detailed.log {
+/var/log/zope/*/*.log {
postrotate
/etc/rc.d/init.d/zope reload >/dev/null 2>&1
endscript
# Define nice level for Zope Server
SERVICE_RUN_NICE_LEVEL="+5"
+# Instances to automatically start
+INSTANCES="main"
+
+# Instances for which all products should be automatically installed
+AUTO_INSTALL_PRODUCTS="main"