mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
umask should be an octal
This commit is contained in:
parent
40514ca2eb
commit
54c8444285
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user