Ubuntu – Proper Way of Setting Umask For php-fpm on Debian/Ubuntu

debianphp-fpmUbuntuumask

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?

Best Answer

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.