On linux, I found webpy cann't run as a daemon. I write a function
daemon:
def daemonize():
"""Become a Linux/UNIX daemon"""
import os,sys
os.chdir('/')
if os.fork():
os._exit(0)
os.setsid()
sys.stdin = sys.__stdin__ = open('/dev/null','r')
sys.stdout = sys.__stdout__ = open('/dev/null','w')
sys.stdout = sys.__stderr__ = os.dup(sys.stdout.fileno())
if __name__ == "__main__":
import sys
strPlatform = sys.platform
if strPlatform != 'win32':
daemonize()
and the run it on linux, but it give the follow error:
Traceback (most recent call last):
File "VSIMSWebServer.py", line 894, in <module>
File "/usr/lib/python2.5/site-packages/web/request.py", line 153, in
run
File "/usr/lib/python2.5/site-packages/web/wsgi.py", line 54, in
runwsgi
File "/usr/lib/python2.5/site-packages/web/httpserver.py", line 220,
in runsimple
AttributeError: 'int' object has no attribute 'write'
how can i do?
thanks for all
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---