38 Commits

Author SHA1 Message Date
benoitc
cc7f595adc Enable stdio inheritance.
Enable inheritance for stdio file descriptors in daemon mode. It allows
you in daemon mode to redirect the output to a file if needed.

By default in daemon mode gunicorn will close all file handle except if
you pass the "-R" options. In this cases STDIO will be preserved.

fix #309
2013-04-23 16:23:46 +02:00
benoitc
c31e0f9ac7 Exit when the config file isn't found.
fix #469
2013-04-21 07:40:06 +02:00
benoitc
78478de364 fix pythonpath option.
fix #501
2013-04-03 11:09:12 +02:00
benoitc
dae4d38705 add syslog support.
Add options to setup logging to syslog:

- `--log-syslog`: enable syslog. It default to `/var/run/syslog` on darwin,
  `/var/run/log` on freebsd, `/dev/log` on openbsd and udp://localhost:514 for
  other platforms.
- `--log-syslog-prefix: Pass the parameter to use as the program name
- `--log-syslog-to`: Setup the syslog address to send message. Address startinf
  by udp:// will send to udp, unix:// to a unix socket and tcp:// to tcp (useful
  for rsyslog)

fix #452 .
2012-12-25 06:19:06 +01:00
benoitc
ac1af72922 s/optparse/argparse 2012-12-25 06:19:06 +01:00
Adnane Belmadiaf
20cd49595a PEP8 fixes 2012-12-24 09:53:03 +01:00
benoitc
9fb0d9669c expose --pythonpath command to all modes . fix #433
--pythonpath may also be useful in other commands, so expose it to all.
2012-11-07 09:52:49 +01:00
benoitc
60644b12af miscellaneous fixes 2012-10-24 14:24:19 +02:00
benoitc
53ce50bc7b obvious syntax fixes preparing python3 support 2012-10-24 12:11:15 +02:00
benoitc
5e37c89017 don't try to set the script as the process group. fix #355
Setting gunicorn as the process group prevent exit from the shell.
2012-05-25 13:40:29 +02:00
benoitc
cc26270783 close #170 .
add --check-config option to check the config and app loading.
2012-02-20 11:13:59 +01:00
benoitc
f168a21dae fix whitespaces 2012-02-19 11:27:46 +01:00
benoitc
66f7271c5f Use our own logger object to log events in gunicorn. While I'm here add
the possibility to manage an access log compatible with apache combined
log format. reopening files is also handled. Also, this change fix
issues #237 and #190.

For the sake of simplicity logging file have been removed

--logfile option has become --error-logfile, by default "-"

Following options have been added:

--access-logfile, the access log file path. By default None. If set
access logs will bre written to defined output

eg:

$ gunicorn -w3 --access-logfile=- test:app
2011-08-21 19:36:52 [84572] [INFO] Starting gunicorn 0.13.0
2011-08-21 19:36:52 [84572] [INFO] Listening at: http://127.0.0.1:8000
(84572)
2011-08-21 19:36:52 [84572] [INFO] Using worker: sync
2011-08-21 19:36:52 [84573] [INFO] Booting worker with pid: 84573
2011-08-21 19:36:52 [84574] [INFO] Booting worker with pid: 84574
2011-08-21 19:36:52 [84575] [INFO] Booting worker with pid: 84575
127.0.0.1 - - [21/Aug/2011:19:37:04] "GET / HTTP/1.1" 200 14 "-"
"curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r
zlib/1.2.5"
2011-08-21 21:08:58 +02:00
benoitc
17b47a376b get settings module name on fork rather than on app initialization. It
allows people to use relative path in their projects. fix issues #219,
and #213
2011-08-21 07:31:58 +02:00
benoitc
dbc61f310e fix issue #143. unnecessary list(). 2011-03-06 10:24:56 +01:00
benoitc
16fd5d3c20 remove some useless code. pyflakes my friend. 2010-12-22 19:52:34 +01:00
benoitc
0716a3bd84 fix issue #136. thanks 2010-12-13 11:17:54 +01:00
benoitc
73d7e906a9 support logging config file in erlir python versions. 2010-12-12 17:00:19 +01:00
benoitc
8e80328114 add support for logging configuration using a ini file. It uses the
standard Python logging's module Configuration file format
(http://docs.python.org/library/logging.html#configuration-file-format)
and allows anyone to use his custom file handler. Fix issues #117 and #111.
2010-12-12 16:13:10 +01:00
benoitc
b62055d529 fail sooner on user and group error. Fix issue #75.
Note: the process could be extended to other variable that need specific
parsing.
2010-12-12 12:38:47 +01:00
benoitc
f29c610916 we aren't the leader all the time. 2010-11-10 19:02:37 +01:00
benoitc
95a4af2a9c display the right error when a worker can't be used. 2010-10-28 06:13:57 +02:00
benoitc
ed66b8b129 some fixes 2010-08-12 11:30:07 +02:00
benoitc
5d9de13b59 close issue #66. Display a more explicit error message and raise. 2010-06-30 04:58:26 +02:00
benoitc
8a1f1ffe4f empty lines 2010-06-17 16:31:28 +02:00
benoitc
5b363c4ab2 make sure we reset config on reload. 2010-06-17 16:23:49 +02:00
benoitc
05b6281e8d new HUP signal handling. Rather than reexecuting the app it mimic NGINX
behavior :

Configuration reload
Start the new worker processes with a new configuration
Gracefully shutdown the old worker processes

To reload gunicorn code use USR2 signal.
2010-06-16 11:10:06 +02:00
benoitc
7c671b72cc et logging handler after we daemonize like it was before. Solve issue
raised by timf : 26f9460e48
2010-06-05 23:15:25 +02:00
Paul J. Davis
7a4aa51703 Improve error message for bad config parameters. 2010-05-23 20:33:13 -04:00
benoitc
f8fac58d73 some fixes discovered with pyflakes 2010-05-23 00:44:53 +02:00
benoitc
9e203e0637 missing import 2010-05-23 00:37:40 +02:00
benoitc
62540cffaa commit changes from @davisp + some fixes 2010-05-22 21:11:25 +02:00
Benoit Chesneau
17a989672d allows Usage=None 2010-05-22 06:14:13 +02:00
Paul J. Davis
6ffbe54734 Added unit tests for new Config code. 2010-05-21 22:54:22 -04:00
Benoit Chesneau
6fbed7ba5b iteritems is deprececated or doesn't exist in future versions of
python3. Instead use list(somedict.items()).
2010-05-19 13:39:39 -04:00
Benoit Chesneau
d46dfad91f fix paster application 2010-05-19 13:39:39 -04:00
Paul J. Davis
793323789d Changing setting definitions from INI to Py
Settings are now enumerated in config.py
2010-05-19 13:39:38 -04:00
Paul J. Davis
036f8b50d9 Major refactor of the configuration mechanics.
* All configuration and bootup is handled by the Application objects.

* There is now a strict ordering on the precedence of configuration
settings:

  1. Each option is given a default value of some sort in options.ini

  2. Any detectable framework configuration settings override the hard
     coded defaults for options. Currently, only Paster applications
     have support for this.

  3. Anything that is specified in a Gunicorn configuration file (by
     default gunicorn.conf.py) overrides what was possibly set by a
     framework specific configuration source.

  4. Anything specified on the command line reins supreme. The command
     line is the final authority on a given configuration option.
     Though, not all configuration options are available via command
     line.

* Configuration metadata is pulled from an options.ini. In the future I'll
use this to build the example gunicorn.conf.py and the config.rst file
in docs/site/config.rst.

I haven't tested the differences thoroughly. The next item on my agenda
is to figure out a way to start testing Gunicorn that doesn't make my
eyes bleed.
2010-05-19 13:39:37 -04:00