diff --git a/scripts/daemon/launch_daemon.php b/scripts/daemon/launch_daemon.php --- a/scripts/daemon/launch_daemon.php +++ b/scripts/daemon/launch_daemon.php @@ -20,6 +20,11 @@ $flags[] = '--load-phutil-library='.phutil_get_library_root($library); } +$umask_octal = PhabricatorEnv::getEnvConfig('phd.umask'); +if (! empty($umask_octal)) { + umask(octdec($umask_octal)); +} + // Add more flags. array_splice($argv, 2, 0, $flags); diff --git a/src/applications/config/option/PhabricatorPHDConfigOptions.php b/src/applications/config/option/PhabricatorPHDConfigOptions.php --- a/src/applications/config/option/PhabricatorPHDConfigOptions.php +++ b/src/applications/config/option/PhabricatorPHDConfigOptions.php @@ -49,6 +49,13 @@ "of output, but can help debug issues. Daemons launched in debug ". "mode with 'phd debug' are always launched in verbose mode. See ". "also 'phd.trace'.")), + $this->newOption('phd.umask', 'string', null) + ->setLocked(true) + ->setSummary(pht('Process umask for phd daemons')) + ->setDescription( + pht( + 'Specify the phd daemon umask to override systems umask.'. + 'Examples: 077, 027, 007')), $this->newOption('phd.user', 'string', null) ->setLocked(true) ->setSummary(pht('System user to run daemons as.'))