Hi all,
I recently upgrade from web2py 1.91.6 to 1.96.4 so I could use the
recaptcha feature (it seems not to work on Firefox and some IE on
1.91.6).
Unfortunately, this seems to have broken my daemon.
When I launch web2py via the command line:
python2.6 web2py.py -p 8180
It works fine.
I should add that I'm using RHEL4 (Red Hat Enterprise Linux AS release
4 (Nahant Update 8) )
Any ideas? Below is the error (import site failed; no module named
os!?!?) and relevant portion of my web2pyd
When I execute /etc/init.d/web2pyd start, i get the following error (I
added -v to the daemon command that launches web2py)
[me@server web2py]$ # installing zipimport hook
import zipimport # builtin
# installed zipimport hook
'import site' failed; traceback:
ImportError: No module named site
Python 2.6 (r26:66714, Feb 22 2011, 11:15:10)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/mnt/internal/web2py/web2py.py", line 4, in <module>
import os
ImportError: No module named os
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] zipimport
# cleanup[1] signal
# cleanup[1] exceptions
# cleanup[1] _warnings
# cleanup sys
# cleanup __builtin__
# cleanup ints: 3 unfreed ints
# cleanup floats
[FAILED]
>>> END OF ERROR <<<
Here is the top portion of the daemon (the start/stop/restart
functions are the same as web2py.fedora.sh in trunk):
#/etc/init.d/web2pyd
...
source /etc/rc.d/init.d/functions
export PYTHONHOME=/usr/local/lib/python2.6/
RETVAL=0
NAME=web2pyd
DESC="Web2py Daemon"
DAEMON_DIR="/mnt/internal/web2py"
ADMINPASS="p@ss"
#ADMINPASS="<recycle>"
PIDFILE=/var/run/$NAME.pid
PORT=8180
PYTHON=/usr/local/bin/python2.6
#PYTHON=/usr/bin/python
cd $DAEMON_DIR
###(proceeds to define start/stop/restart/usage/etc