Mercurial > p > roundup > code
comparison roundup/scripts/roundup_server.py @ 3609:f2fda3e6fc8b
umask is now configurable (with the same 0002 default)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 27 Apr 2006 04:59:37 +0000 |
| parents | 7bf2b4523b75 |
| children | 2addec69757a |
comparison
equal
deleted
inserted
replaced
| 3608:19c0ee158c29 | 3609:f2fda3e6fc8b |
|---|---|
| 15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 16 # | 16 # |
| 17 | 17 |
| 18 """Command-line script that runs a server over roundup.cgi.client. | 18 """Command-line script that runs a server over roundup.cgi.client. |
| 19 | 19 |
| 20 $Id: roundup_server.py,v 1.82 2006-02-22 05:40:56 a1s Exp $ | 20 $Id: roundup_server.py,v 1.83 2006-04-27 04:59:37 richard Exp $ |
| 21 """ | 21 """ |
| 22 __docformat__ = 'restructuredtext' | 22 __docformat__ = 'restructuredtext' |
| 23 | 23 |
| 24 import errno, cgi, getopt, os, socket, sys, traceback, urllib, time | 24 import errno, cgi, getopt, os, socket, sys, traceback, urllib, time |
| 25 import ConfigParser, BaseHTTPServer, SocketServer, StringIO | 25 import ConfigParser, BaseHTTPServer, SocketServer, StringIO |
| 655 pidfile.write(str(pid)) | 655 pidfile.write(str(pid)) |
| 656 pidfile.close() | 656 pidfile.close() |
| 657 os._exit(0) | 657 os._exit(0) |
| 658 | 658 |
| 659 os.chdir("/") | 659 os.chdir("/") |
| 660 os.umask(0) | |
| 661 | 660 |
| 662 # close off std(in|out|err), redirect to devnull so the file | 661 # close off std(in|out|err), redirect to devnull so the file |
| 663 # descriptors can't be used again | 662 # descriptors can't be used again |
| 664 devnull = os.open('/dev/null', 0) | 663 devnull = os.open('/dev/null', 0) |
| 665 os.dup2(devnull, 0) | 664 os.dup2(devnull, 0) |
