I'd like to set umask to 002 for the php-fpm process. I'm reading here and here that on Ubuntu/Debian it is supposed to be done by modifying the init script.
I'm having doubts however that this is the proper way. Just thinking about the case php5-fpm gets updated and an update modifies the init script.
I also read here that for CentOS/Redhat you can set it via /etc/sysconfig/
.
So my question is whether there is a proper way on Debian/Ubuntu to set the umask without modifying the init script? In case there is not, is it OK to modify the init script directly?
I know this is old, but for anyone else who comes along modifying www.conf and adding env[UMASK] = 0002 solved the problem. Note the three 000 before the 2, no two as in the respondent's answer above.
Corresponding to the debian maintainer you can use the /etc/apache2/envvars for apache, so maybe there is a corresponding file for phpfpm? Also systemd has a umask setting in unit files, however I don't think it is honored if the service does not have a native systemd unit file.
You can always change Umask for whole Systemd service by adding config file
/etc/systemd/system/my-service-name-whatever.d/umask.conf
with content like: