app/django/core/servers/fastcgi.py
changeset 323 ff1a9aa48cfd
parent 54 03e267d67478
equal deleted inserted replaced
322:6641e941ef1e 323:ff1a9aa48cfd
    38   daemonize=BOOL       whether to detach from terminal.
    38   daemonize=BOOL       whether to detach from terminal.
    39   pidfile=FILE         write the spawned process-id to this file.
    39   pidfile=FILE         write the spawned process-id to this file.
    40   workdir=DIRECTORY    change to this directory when daemonizing.
    40   workdir=DIRECTORY    change to this directory when daemonizing.
    41   outlog=FILE          write stdout to this file.
    41   outlog=FILE          write stdout to this file.
    42   errlog=FILE          write stderr to this file.
    42   errlog=FILE          write stderr to this file.
       
    43   umask=UMASK          umask to use when daemonizing (default 022).
    43 
    44 
    44 Examples:
    45 Examples:
    45   Run a "standard" fastcgi process on a file-descriptor
    46   Run a "standard" fastcgi process on a file-descriptor
    46   (for webservers which spawn your processes for you)
    47   (for webservers which spawn your processes for you)
    47     $ manage.py runfcgi method=threaded
    48     $ manage.py runfcgi method=threaded
    71     'minspare': 2,
    72     'minspare': 2,
    72     'maxchildren': 50,
    73     'maxchildren': 50,
    73     'maxrequests': 0,
    74     'maxrequests': 0,
    74     'outlog': None,
    75     'outlog': None,
    75     'errlog': None,
    76     'errlog': None,
       
    77     'umask': None,
    76 }
    78 }
    77 
    79 
    78 def fastcgi_help(message=None):
    80 def fastcgi_help(message=None):
    79     print FASTCGI_HELP
    81     print FASTCGI_HELP
    80     if message:
    82     if message:
   157     daemon_kwargs = {}
   159     daemon_kwargs = {}
   158     if options['outlog']:
   160     if options['outlog']:
   159         daemon_kwargs['out_log'] = options['outlog']
   161         daemon_kwargs['out_log'] = options['outlog']
   160     if options['errlog']:
   162     if options['errlog']:
   161         daemon_kwargs['err_log'] = options['errlog']
   163         daemon_kwargs['err_log'] = options['errlog']
       
   164     if options['umask']:
       
   165         daemon_kwargs['umask'] = int(options['umask'])
   162 
   166 
   163     if daemonize:
   167     if daemonize:
   164         from django.utils.daemonize import become_daemon
   168         from django.utils.daemonize import become_daemon
   165         become_daemon(our_home_dir=options["workdir"], **daemon_kwargs)
   169         become_daemon(our_home_dir=options["workdir"], **daemon_kwargs)
   166 
   170