From 54c8444285e9ba3bd640b5c3aa0ad42a2b5302cc Mon Sep 17 00:00:00 2001 From: benoitc Date: Sun, 21 Feb 2010 11:59:00 +0100 Subject: [PATCH] umask should be an octal --- gunicorn/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gunicorn/main.py b/gunicorn/main.py index 0c178215..1fbe78da 100644 --- a/gunicorn/main.py +++ b/gunicorn/main.py @@ -39,7 +39,7 @@ def options(): help='set the background PID FILE'), op.make_option('-D', '--daemon', dest='daemon', action="store_true", help='Run daemonized in the background.'), - op.make_option('-m', '--umask', dest="umask", type='int', + op.make_option('-m', '--umask', dest="umask", type='string', help="Define umask of daemon process"), op.make_option('-u', '--user', dest="user", help="Change worker user"), @@ -80,7 +80,7 @@ def daemonize(umask): if os.fork() == 0: os.setsid() if os.fork() == 0: - os.umask(umask) + os.umask(int(umask, 0)) else: os._exit(0) else: @@ -135,6 +135,7 @@ def main(usage, get_app): if conf['daemon']: daemonize(conf['umask']) else: + os.umask(int(conf['umask'], 0)) os.setpgrp() set_owner_process(conf['user'], conf['group']) configure_logging(conf)