diff options
author | Holger Brueckner <darks@gentoo.org> | 2001-09-19 18:16:44 +0000 |
---|---|---|
committer | Holger Brueckner <darks@gentoo.org> | 2001-09-19 18:16:44 +0000 |
commit | 3ae2a761fc75cea04223c48bd98eeeb79a24b450 (patch) | |
tree | 025f5909260c858bbebfe10ea3a4a5bda62e309f /net-www/zope | |
parent | masked kde-env-2.2.1 until problems are resolved. will presently post to gent... (diff) | |
download | historical-3ae2a761fc75cea04223c48bd98eeeb79a24b450.tar.gz historical-3ae2a761fc75cea04223c48bd98eeeb79a24b450.tar.bz2 historical-3ae2a761fc75cea04223c48bd98eeeb79a24b450.zip |
fixed startup script so that zope actually starts ;)
added rc6 init script
Diffstat (limited to 'net-www/zope')
-rw-r--r-- | net-www/zope/files/zope | 2 | ||||
-rw-r--r-- | net-www/zope/files/zope.rc6 | 202 | ||||
-rw-r--r-- | net-www/zope/zope-2.4.0-r6.ebuild | 115 | ||||
-rw-r--r-- | net-www/zope/zope-2.4.0.ebuild | 3 |
4 files changed, 321 insertions, 1 deletions
diff --git a/net-www/zope/files/zope b/net-www/zope/files/zope index 6f5d0a254544..54231fbed206 100644 --- a/net-www/zope/files/zope +++ b/net-www/zope/files/zope @@ -57,6 +57,7 @@ start_zope() { unset PYTHONPATH /usr/bin/env python z2.py \ -u nobody \ + -p - \ -z $ZOPE_HOME \ -Z /var/run/zwatchdog.pid \ -w $ZOPE_PORT \ @@ -70,6 +71,7 @@ start_zope() { else /usr/bin/env python z2.py \ -u nobody \ + -p - \ -z $ZOPE_HOME \ -Z /var/run/zwatchdog.pid \ -w $ZOPE_PORT \ diff --git a/net-www/zope/files/zope.rc6 b/net-www/zope/files/zope.rc6 new file mode 100644 index 000000000000..57facfca47d1 --- /dev/null +++ b/net-www/zope/files/zope.rc6 @@ -0,0 +1,202 @@ +#!/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 + +depend() { + need net +} + +USEZEO="`/usr/lib/portage/bin/use zeo`" + +SERVICE=zope +opts="start stop restart status" + +export INSTANCE_HOME=/var/lib/zope +export INSTANCE_NAME=`basename ${INSTANCE_HOME}` +export ZOPE_HOME=/usr/share/zope +export ZOPE_PORT=80 +export ZOPE_LOG="/var/log/zope" +export ZEO_SERVER_PORT=5800 +export ZEO_SERVER_NAME="localhost" + +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 nobody \ + -z $ZOPE_HOME \ + -Z /var/run/zwatchdog.pid \ + -w '' \ + -f 8021 \ + -m '' \ + -l $ZOPE_LOG \ + 2>&1 >> /var/log/zope \ + & + else + if [ $USEZEO ]; then + export PYTHONPATH=/usr/lib/python2.1/:/usr/lib/python2.1/lib-dynload/ + /usr/bin/env python zctl.py start_zeo + unset PYTHONPATH + /usr/bin/env python z2.py \ + -u nobody \ + -p - \ + -z $ZOPE_HOME \ + -Z /var/run/zwatchdog.pid \ + -w $ZOPE_PORT \ + -f 8021 \ + -W 8023 \ + -m '' \ + -l $ZOPE_LOG \ + -D \ + 2>&1 >> /var/log/zope \ + & + else + /usr/bin/env python z2.py \ + -u nobody \ + -p - \ + -z $ZOPE_HOME \ + -Z /var/run/zwatchdog.pid \ + -w $ZOPE_PORT \ + -f 8021 \ + -W 8023 \ + -m '' \ + -l $ZOPE_LOG \ + -D \ + 2>&1 >> /var/log/zope \ + & + fi + 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 + if [ $USEZEO ]; then + /usr/bin/env python ${INSTANCE_HOME}/zctl.py stop_zeo + fi + eend $? "Error stopping $SERVICE" + } + +restart(){ + stop + start + } + +status(){ + echo "Checking for zope: " + chkstatus zwatchdog + chkstatus zserver + if [ $USEZEO ]; then + /usr/bin/env python ${INSTANCE_HOME}/zctl.py status + fi + } + + diff --git a/net-www/zope/zope-2.4.0-r6.ebuild b/net-www/zope/zope-2.4.0-r6.ebuild new file mode 100644 index 000000000000..68f35cdcfcbe --- /dev/null +++ b/net-www/zope/zope-2.4.0-r6.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Holger Brueckner <darks@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/net-www/zope/zope-2.4.0-r6.ebuild,v 1.1 2001/09/19 18:16:44 darks Exp $ + +A="Zope-${PV}-src.tgz ZEO-1.0b3.tgz" +S=${WORKDIR}/Zope-${PV}-src +DESCRIPTION="Zope is web application platform used for building high-performance, dynamic web sites." +SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz + http://www.zope.org/Products/ZEO/ZEO-1.0b3.tgz" +HOMEPAGE="http://www.zope.org" + +DEPEND="virtual/glibc + >=dev-lang/python-2.1" +RDEPEND=">=dev-lang/python-2.1" + +src_unpack() { + + unpack Zope-${PV}-src.tgz + + if [ "`use zeo`" ]; then + cd ${S}/lib/python + unpack ZEO-1.0b3.tgz + mv ZEO-1.0b3/ZEO ${S}/lib/python + rm -rf ZEO-1.0b3 + fi +} + +src_compile() { + try python w_pcgi.py +} + +src_install () { + + ZDIR=/usr/share/zope + ZVAR=/var/lib/zope + + + dodir ${ZDIR}/var + insinto ${ZDIR} + doins w_pcgi.py wo_pcgi.py + + dodir ${ZDIR}/lib + cp -a lib/* ${D}${ZDIR}/lib/ + cp -a ZServer utilities ${D}${ZDIR} + rm ${D}${ZDIR}/ZServer/*.txt + exeinto ${ZDIR}/pcgi + doexe pcgi/pcgi-wrapper pcgi/pcgi_publisher.py + + dodir ${ZDIR}/inst + cp -a inst/* ${D}${ZDIR}/inst + + dodir ${ZDIR}/pcgi + cp -a pcgi/* ${D}${ZDIR}/pcgi + + cd ${S} + fperms a+x ${ZDIR}/lib/python/zdaemon.py + fperms a+x ${ZDIR}/lib/python/StructuredText/StructuredText.py + fperms a+x ${ZDIR}/lib/python/ZPublisher/Client.py + + dodir ${ZVAR} + insinto ${ZVAR} + doins z2.py + insinto ${ZVAR}/var + insopts -m644 + doins var/Data.fs.in + dodir ${ZVAR}/Extensions + dodir ${ZVAR}/import + dodir ${ZVAR}/Products + + if [ "`use zeo`" ]; then + insinto ${ZVAR} + doins ${FILESDIR}/zctl.py ${FILESDIR}/zope ${FILESDIR}/zope.conf ${FILESDIR}/custom_zodb.py + fi + + exeinto ${ZDIR} + doexe zpasswd.py Zope.cgi + + cd ${D}${ZDIR} + sed -e "s:${WORKDIR}:${ZDIR}:g" Zope.cgi > Zope.cgi.tmp + mv Zope.cgi.tmp Zope.cgi + sed -e "s:${WORKDIR}:${ZVAR}:g" stop > stop.tmp + mv stop.tmp stop + + dodir /etc/init.d + exeinto /etc/init.d + newexe ${FILESDIR}/zope.rc6 zope + chown nobody.users ${ZVAR}/var/* +} + +pkg_postinst() { + if [ ! -f ${ROOT}/var/lib/zope/var/Data.fs ] + then + echo "Installing Data.fs from template..." + cd ${ROOT}/var/lib/zope/var + cp Data.fs.in Data.fs + echo + echo "Fixing permissions..." + chown nobody.nogroup -R ${ROOT}/var/lib/zope/var + chmod 600 ${ROOT}/var/lib/zope/var/Data.fs + echo + fi + if [ ! -f ${ROOT}/var/lib/zope/access ] + then + echo "You must run" + echo + echo /usr/share/zope/zpasswd.py /var/lib/zope/inituser + if [ "`use zeo`" ]; then + echo and edit /var/lib/zope/zope.conf + fi + + echo + echo before you can start zope + fi +} diff --git a/net-www/zope/zope-2.4.0.ebuild b/net-www/zope/zope-2.4.0.ebuild index ad84e6680fc7..f0fd22bbc7a4 100644 --- a/net-www/zope/zope-2.4.0.ebuild +++ b/net-www/zope/zope-2.4.0.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2000 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author Holger Brueckner <darks@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/net-www/zope/zope-2.4.0.ebuild,v 1.2 2001/08/06 11:53:48 darks Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-www/zope/zope-2.4.0.ebuild,v 1.3 2001/09/19 18:16:44 darks Exp $ A="Zope-${PV}-src.tgz ZEO-1.0b3.tgz" S=${WORKDIR}/Zope-${PV}-src @@ -85,6 +85,7 @@ src_install () { dodir /etc/rc.d/init.d exeinto /etc/rc.d/init.d doexe ${FILESDIR}/zope + chown nobody.users ${ZVAR}/var/* } pkg_postinst() { |