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'),
|
help='set the background PID FILE'),
|
||||||
op.make_option('-D', '--daemon', dest='daemon', action="store_true",
|
op.make_option('-D', '--daemon', dest='daemon', action="store_true",
|
||||||
help='Run daemonized in the background.'),
|
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"),
|
help="Define umask of daemon process"),
|
||||||
op.make_option('-u', '--user', dest="user",
|
op.make_option('-u', '--user', dest="user",
|
||||||
help="Change worker user"),
|
help="Change worker user"),
|
||||||
@ -80,7 +80,7 @@ def daemonize(umask):
|
|||||||
if os.fork() == 0:
|
if os.fork() == 0:
|
||||||
os.setsid()
|
os.setsid()
|
||||||
if os.fork() == 0:
|
if os.fork() == 0:
|
||||||
os.umask(umask)
|
os.umask(int(umask, 0))
|
||||||
else:
|
else:
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
else:
|
else:
|
||||||
@ -135,6 +135,7 @@ def main(usage, get_app):
|
|||||||
if conf['daemon']:
|
if conf['daemon']:
|
||||||
daemonize(conf['umask'])
|
daemonize(conf['umask'])
|
||||||
else:
|
else:
|
||||||
|
os.umask(int(conf['umask'], 0))
|
||||||
os.setpgrp()
|
os.setpgrp()
|
||||||
set_owner_process(conf['user'], conf['group'])
|
set_owner_process(conf['user'], conf['group'])
|
||||||
configure_logging(conf)
|
configure_logging(conf)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user