Confusion over INST_HOME and INSTANCE_HOME
Hi, I have this which is from a stock 2.3.3 distribution under Solaris: 219 % more start #! /bin/sh reldir=`dirname $0` INST_HOME=`cd $reldir; pwd` export INST_HOME exec /usr/local/bin/python2.1 \ $INST_HOME/z2.py "$@" When started up, this works fine. Looking for INST_HOME in the src tree I get: 220 % find . -print | xargs grep INST_HOME ./inst/make_start.py: varname='INST_HOME' Binary file ./inst/make_start.pyc matches ./start:INST_HOME=`cd $reldir; pwd` ./start:export INST_HOME ./start: $INST_HOME/z2.py "$@" Doing the same for INSTANCE_HOME brings back 52 lines of matches. I'm using the How-To at <http://www.zope.org/Members/4am/instancehome> to have one source installation serve up loads of mini zope sites. It has always worked well under 2.3.0, and here's a 'start' file that does work. Thr python used is 1.52 (Zope 2.3.0) #! /bin/sh reldir=`dirname $0` INSTANCE_HOME=`cd $reldir; pwd` export INSTANCE_HOME PYTHONHOME=/home/zope/Zope-2.3.0-src export PYTHONHOME exec /usr/local/bin/python $PYTHONHOME/z2.py "$@" Whereas this start file under Zope 2.3.3, (note: I've got both INST_HOME and INSTANCE_HOME defined). This is also a python2.1 distribution #! /bin/sh reldir=`dirname $0` INSTANCE_HOME=`cd $reldir; pwd` INST_HOME=`cd $reldir; pwd` export INSTANCE_HOME export INST_HOME PYTHONHOME=/home/zope/Zope-2.3.3-src export PYTHONHOME exec /usr/local/bin/python2.1 $PYTHONHOME/z2.py "$@" Gives an import error 243 % ./start 'import site' failed; use -v for traceback Traceback (most recent call last): File "/home/zope/Zope-2.3.3-src/z2.py", line 296, in ? import os, sys, getopt, string ImportError: No module named os Does anyone know what I'm doing wrong here? -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
From: "Tony McDonald" <tony.mcdonald@ncl.ac.uk>
PYTHONHOME=/home/zope/Zope-2.3.3-src export PYTHONHOME exec /usr/local/bin/python2.1 $PYTHONHOME/z2.py "$@"
Gives an import error 243 % ./start 'import site' failed; use -v for traceback
The environment variable PYTHONHOME is meaningful to Python 2.0 and above, and causes this error. That's why "start" scripts generated under these versions use "INST_HOME" instead. The name is an unfortunate coincidence, and has nothing to do with "INSTANCE_HOME", so just edit your scripts to use a different name in place of "PYTHONHOME". Cheers, Evan @ digicool & 4-am
On 27/6/01 6:37 pm, "Evan Simpson" <evan@4-am.com> wrote:
From: "Tony McDonald" <tony.mcdonald@ncl.ac.uk>
PYTHONHOME=/home/zope/Zope-2.3.3-src export PYTHONHOME exec /usr/local/bin/python2.1 $PYTHONHOME/z2.py "$@"
Gives an import error 243 % ./start 'import site' failed; use -v for traceback
The environment variable PYTHONHOME is meaningful to Python 2.0 and above, and causes this error. That's why "start" scripts generated under these versions use "INST_HOME" instead. The name is an unfortunate coincidence, and has nothing to do with "INSTANCE_HOME", so just edit your scripts to use a different name in place of "PYTHONHOME".
Cheers,
Evan @ digicool & 4-am
Sorry for the late reply Evan, That is *excellent* - the 'start' file here works... #! /bin/sh reldir=`dirname $0` INSTANCE_HOME=`cd $reldir; pwd` export INSTANCE_HOME WHERE_ZOPE_LIVES=/home/zope/Zope-2.3.3-src export WHERE_ZOPE_LIVES LD_LIBRARY_PATH='/usr/local/lib/:/usr/lib:/usr/local/ssl/lib:/usr/local/lib/ mysql' export LD_LIBRARY_PATH exec /usr/local/bin/python2.1 $WHERE_ZOPE_LIVES/z2.py "$@" I wouldn't have found that for a bl**dy long time ;) Cheers again Tone. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
Hi Tony, I am having the same problem, as you describe, see my original post http://lists.zope.org/pipermail/zope/2001-June/093347.html I was told by Evan @ digicool & 4-am that the INST_HOME was a typo and it should be INSTANCE_HOME, so perhaps the problem is with 2.3.3 I am using FreeBSD, not that I know if it makes a difference, and was also following the http://www.zope.org/Members/4am/instancehome how-to. What confuses me ;^) is that to run zope from single tree with INST_HOME in the start up works fine, but when I create a start script in the InstanceHome dir that it fails. Sorry I can't be of help, but hopefully you would not feel alone, heh? Regards Norman -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Tony McDonald Sent: 27 June 2001 13:17 To: Zope Subject: [Zope] Confusion over INST_HOME and INSTANCE_HOME Hi, I have this which is from a stock 2.3.3 distribution under Solaris: 219 % more start #! /bin/sh reldir=`dirname $0` INST_HOME=`cd $reldir; pwd` export INST_HOME exec /usr/local/bin/python2.1 \ $INST_HOME/z2.py "$@" When started up, this works fine. Looking for INST_HOME in the src tree I get: 220 % find . -print | xargs grep INST_HOME ./inst/make_start.py: varname='INST_HOME' Binary file ./inst/make_start.pyc matches ./start:INST_HOME=`cd $reldir; pwd` ./start:export INST_HOME ./start: $INST_HOME/z2.py "$@" Doing the same for INSTANCE_HOME brings back 52 lines of matches. I'm using the How-To at <http://www.zope.org/Members/4am/instancehome> to have one source installation serve up loads of mini zope sites. It has always worked well under 2.3.0, and here's a 'start' file that does work. Thr python used is 1.52 (Zope 2.3.0) #! /bin/sh reldir=`dirname $0` INSTANCE_HOME=`cd $reldir; pwd` export INSTANCE_HOME PYTHONHOME=/home/zope/Zope-2.3.0-src export PYTHONHOME exec /usr/local/bin/python $PYTHONHOME/z2.py "$@" Whereas this start file under Zope 2.3.3, (note: I've got both INST_HOME and INSTANCE_HOME defined). This is also a python2.1 distribution #! /bin/sh reldir=`dirname $0` INSTANCE_HOME=`cd $reldir; pwd` INST_HOME=`cd $reldir; pwd` export INSTANCE_HOME export INST_HOME PYTHONHOME=/home/zope/Zope-2.3.3-src export PYTHONHOME exec /usr/local/bin/python2.1 $PYTHONHOME/z2.py "$@" Gives an import error 243 % ./start 'import site' failed; use -v for traceback Traceback (most recent call last): File "/home/zope/Zope-2.3.3-src/z2.py", line 296, in ? import os, sys, getopt, string ImportError: No module named os Does anyone know what I'm doing wrong here? -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Evan Simpson -
Norman Khine -
Tony McDonald