0

I am currently running nginx with php5-fpm on my local development ubuntu 13.10 system with 3.12.0 linux kernel.

Before update, to set umask to 0002 for php5-fpm I edited /etc/init.d/php5-fpm file and added --umask arg to start-stop-daemon line.

After update it is ignored.

All points that now I run upstart instead of bare old system V scripts.

I tried to add umask 0002 to /etc/init/php5-fpm.conf but no luck

baldrs
  • 103
  • 1
  • 5

1 Answers1

0

After long boring google search the answer is:

umask 0002

In the very start of /etc/init.d/php5-fpm

I checked it with gdb to be really sure(gdb --pid=PID of php5-fpm):

(gdb) call umask(0)
$1 = 2
(gdb) call umask(2)
$2 = 0
baldrs
  • 103
  • 1
  • 5
  • The init script should not be modified (it could be overwritten by a package update), putting it in `/etc/default/php5-fpm` is probably safer (this file is sourced near the beginning of the init script). – bufh Jan 28 '16 at 09:14
  • I have since then moved to systemd which just allows UMask=0002 in the unit files, and overriding system files with the custom unit files. http://man7.org/linux/man-pages/man5/systemd.exec.5.html – baldrs Jan 28 '16 at 13:14