Mercurial > p > roundup > code
comparison roundup/scripts/roundup_server.py @ 2843:46ad912ddd2b
describe -t option in help; remove unused win32 imports
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Sat, 30 Oct 2004 08:43:06 +0000 |
| parents | 98e2e7b57101 |
| children | e8cb25c30ac9 |
comparison
equal
deleted
inserted
replaced
| 2842:98e2e7b57101 | 2843:46ad912ddd2b |
|---|---|
| 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.70 2004-10-30 08:23:51 a1s Exp $ | 20 $Id: roundup_server.py,v 1.71 2004-10-30 08:43:06 a1s Exp $ |
| 21 """ | 21 """ |
| 22 __docformat__ = 'restructuredtext' | 22 __docformat__ = 'restructuredtext' |
| 23 | 23 |
| 24 import errno, cgi, getopt, os, socket, sys, traceback, urllib | 24 import errno, cgi, getopt, os, socket, sys, traceback, urllib |
| 25 import ConfigParser, BaseHTTPServer, SocketServer, StringIO | 25 import ConfigParser, BaseHTTPServer, SocketServer, StringIO |
| 420 RoundupService = None | 420 RoundupService = None |
| 421 else: | 421 else: |
| 422 | 422 |
| 423 # allow the win32 | 423 # allow the win32 |
| 424 import win32service | 424 import win32service |
| 425 import win32event | |
| 426 import win32file | |
| 427 | 425 |
| 428 class SvcShutdown(Exception): | 426 class SvcShutdown(Exception): |
| 429 pass | 427 pass |
| 430 | 428 |
| 431 class RoundupService(win32serviceutil.ServiceFramework): | 429 class RoundupService(win32serviceutil.ServiceFramework): |
| 484 os_part = ""''' -u <UID> runs the Roundup web server as this UID | 482 os_part = ""''' -u <UID> runs the Roundup web server as this UID |
| 485 -g <GID> runs the Roundup web server as this GID | 483 -g <GID> runs the Roundup web server as this GID |
| 486 -d <PIDfile> run the server in the background and write the server's PID | 484 -d <PIDfile> run the server in the background and write the server's PID |
| 487 to the file indicated by PIDfile. The -l option *must* be | 485 to the file indicated by PIDfile. The -l option *must* be |
| 488 specified if -d is used.''' | 486 specified if -d is used.''' |
| 489 port=DEFAULT_PORT | |
| 490 if message: | 487 if message: |
| 491 message += '\n' | 488 message += '\n' |
| 492 print _('''%(message)sUsage: roundup-server [options] [name=tracker home]* | 489 print _('''%(message)sUsage: roundup-server [options] [name=tracker home]* |
| 493 | 490 |
| 494 Options: | 491 Options: |
| 498 -C <fname> use configuration file <fname> | 495 -C <fname> use configuration file <fname> |
| 499 -n <name> set the host name of the Roundup web server instance | 496 -n <name> set the host name of the Roundup web server instance |
| 500 -p <port> set the port to listen on (default: %(port)s) | 497 -p <port> set the port to listen on (default: %(port)s) |
| 501 -l <fname> log to the file indicated by fname instead of stderr/stdout | 498 -l <fname> log to the file indicated by fname instead of stderr/stdout |
| 502 -N log client machine names instead of IP addresses (much slower) | 499 -N log client machine names instead of IP addresses (much slower) |
| 500 -t <mode> multiprocess mode (default: %(mp_def)s). | |
| 501 Allowed values: %(mp_types)s. | |
| 503 %(os_part)s | 502 %(os_part)s |
| 504 | 503 |
| 505 Long options: | 504 Long options: |
| 506 --version print the Roundup version number and exit | 505 --version print the Roundup version number and exit |
| 507 --help print this text and exit | 506 --help print this text and exit |
| 534 tracker is identified in the URL (it's the first part of the URL path). | 533 tracker is identified in the URL (it's the first part of the URL path). |
| 535 The tracker home is the directory that was identified when you did | 534 The tracker home is the directory that was identified when you did |
| 536 "roundup-admin init". You may specify any number of these name=home | 535 "roundup-admin init". You may specify any number of these name=home |
| 537 pairs on the command-line. Make sure the name part doesn't include | 536 pairs on the command-line. Make sure the name part doesn't include |
| 538 any url-unsafe characters like spaces, as these confuse IE. | 537 any url-unsafe characters like spaces, as these confuse IE. |
| 539 ''')%locals() | 538 ''') % { |
| 540 #sys.exit(0) | 539 "message": message, |
| 540 "os_part": os_part, | |
| 541 "port": DEFAULT_PORT, | |
| 542 "mp_def": DEFAULT_MULTIPROCESS, | |
| 543 "mp_types": ", ".join(MULTIPROCESS_TYPES), | |
| 544 } | |
| 541 | 545 |
| 542 | 546 |
| 543 def daemonize(pidfile): | 547 def daemonize(pidfile): |
| 544 ''' Turn this process into a daemon. | 548 ''' Turn this process into a daemon. |
| 545 - make sure the sys.std(in|out|err) are completely cut off | 549 - make sure the sys.std(in|out|err) are completely cut off |
