Change umask for apache user

Hi,

I need to change the umask for apache user so that the other group memebers have write access to the files. The apache user has no login shell running under centos 5.6. Currently apache user have 022 umask and i need to change to 002 so that other group memeber can have write access to that file.

The httpd service runs under apache user and the file are created using php open file function.

Now i have couple of options

  1. Add the line in httpd file as below and restart the service
 
   [root ~]$ echo "umask 002" >> /etc/sysconfig/httpd
   [root ~]$ service httpd stop
   [root ~]$ service httpd start
 
  1. change the uid of the apache user above 99 so that by default it gets the 002 umask as it has same group name as that of uid.

Not sure if the first approch works as i have got only one chance to test it.

Could anyone let me know if i am missing any steps in first step as i am thinking to add a line of umask 002 in /etc/init.d/httpd startup script at the start if the above step 1 doesnt work?

Thanks,
P

  1. seems right, try it.