[Zope-DB] DCOracle2 doesn't work when Zope started as a service

Anton Hughes Anton.Hughes@utas.edu.au
Thu, 8 May 2003 11:28:56 +1000


Hi All,

I use an /etc/init.d script to automatically start Zope when our server
starts. Although Zope is starting properly, none of the DCOracle2
connections work when it is started in this way. Originally I thought it was
a timing problem since Oracle would be starting up at around the same time,
but starting it from a command prompt using '/sbin/service zope start' also
fails even when I know Oracle is running.

The problem doesn't happen when I use /home/zope/start at the command line.
So I'm at a loss. Attached are my /etc/init.d/zope script and
/home/zope/start script in the hope that they shed some light on my
problems...

Thanks in advance.

Anton

Data Administrator
Childhood Determinants of Adult Health Project
Menzies Centre for Population Health Research
Private Bag 23, Hobart Tasmania 7001

Email: anton.hughes@utas.edu.au
Web:  http://www.menzies.utas.edu.au/cohort/CDAH.htm
Phone: +61 (0) 3 6226 7761


/etc/init.d/zope:
=================

#!/bin/sh

# Source funcion library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up
if [ ${NETWORKING} = "no" ]
then
        exit 0
fi

# See how we were called.
case "$1" in
  start)
        echo "Starting Zope service. "

        #action "Checking that PostgreSQL has started: " /sbin/service
postgresq                l start
        #action "Checking that Apache has started: "
/usr/local/apache/bin/apach                ectl start
        /home/zope/start

        ;;
  stop)
        echo -n "Stopping Zope service. "

        /home/zope/stop
        ;;
  restart|reload)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: zope {start|stop|restart}"
        exit 1
esac

exit 0


#==========END /etc/init.d/zope==================#

/home/zope/start:
=================
#!/bin/sh
umask 077
reldir=`dirname $0`
cwd=`cd $reldir; pwd`
INSTANCE_HOME=$cwd
export INSTANCE_HOME
# Zope's event logger is controlled by the "EVENT_LOG_FILE" environment
# variable.  If you don't have a "EVENT_LOG_FILE" environment variable
# (or its older alias "STUPID_LOG_FILE") set, Zope will log to the standard
# output.  For more information on EVENT_LOG_FILE, see doc/ENVIRONMENT.txt.
ZLOGFILE=$EVENT_LOG_FILE
if [ -z "$ZLOGFILE" ]; then
        ZLOGFILE=$STUPID_LOG_FILE
fi
if [ -z "$ZLOGFILE" ]; then
        EVENT_LOG_FILE=""
        export EVENT_LOG_FILE
fi
exec /usr/local/bin/python2.1 /usr/local/zope/z2.py -P0 -u zope "$@"