From 6497d5aab21ebcd8958a4045959bd4c56f67dc3b Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Tue, 16 Feb 2010 08:33:49 +0100 Subject: [PATCH] some fixes. --- gunicorn/main.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gunicorn/main.py b/gunicorn/main.py index 63f3e083..f7eb09a1 100644 --- a/gunicorn/main.py +++ b/gunicorn/main.py @@ -142,8 +142,17 @@ def main(usage, get_app): parser.set_defaults(**default_options) opts, args = parser.parse_args() - fileopts = get_config(opts.config) or {} + if opts.config: + conf_file = opts.config + else: + conf_file = os.path.join(os.getcwd(), "gunicorn.conf.py") + + if os.path.isfile(conf_file): + fileopts = get_config(conf_file) or {} + else: + fileopts = {} + # optparse returns object, we want a dict opts = opts.__dict__ @@ -171,13 +180,13 @@ def main(usage, get_app): pidfile=config['pidfile'] ) - arbiter = Arbiter(addr, workers, app, args[0], **kwargs) + arbiter = Arbiter(addr, workers, app, **kwargs) if config['daemon']: daemonize(umask) else: os.setpgrp() - set_owner_process(opts.user, opts.group) + set_owner_process(config['user'], config['group']) configure_logging(config) arbiter.run()