potiuk commented on a change in pull request #7724: [AIRFLOW-1536] Inherit
umask from parent process in daemon mode
URL: https://github.com/apache/airflow/pull/7724#discussion_r392602337
##########
File path: airflow/cli/commands/celery_command.py
##########
@@ -135,6 +135,7 @@ def worker(args):
ctx = daemon.DaemonContext(
files_preserve=[handle],
+ umask=cli_utils.get_umask(),
Review comment:
I think rather than reading from a parent we should allow to set it to a
fixed value from configuration (with a reasonable default - for example 0o077).
From the documentation of umask parameter in DaemonContext:
```
File access creation mask (“umask”) to set for the process on daemon start.
A daemon should not rely on the parent process's umask value, which is
beyond its control and may
prevent creating a file with the required access mode. So when the daemon
context opens, the umask
is set to an explicit known value.
If the conventional value of 0 is too open, consider setting a value such as
0o022, 0o027, 0o077, or
another specific value. Otherwise, ensure the daemon creates every file with
an explicit access mode
for the purpose.
```
via https://kite.com/python/docs/daemon.DaemonContext
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services