[Django]-Socket permissions when running Django with FastCGI

4👍

./manage.py runfcgi help says:

umask=UMASK umask to use when daemonizing (default 022).

So you just need to run:

./manage.py runfcgi socket=$FCGISOCKET umask=007

and a socket with mode 0770 will be created. Please note that umask is being set only when daemonize is set to true (which is default).

1👍

can’t find a way to do this with fastcgi, added a os.fchmod at the end of my settings.py and that seems to make it work. still its a horrible hack and they should allow you to set it when invoking the service.

👤justme

1👍

umask= doesn’t work when running with daemonize=false. In this case, it’ll just use your current os umask, so run umask 0007 before your script.

👤rumpel

Leave a comment