Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using supervisord to handle some gevent based wsgi processes that simply run a django app.

When I upload files I want them to have rw permissions for user and group (www-data) and of course I want the folders to have execute permissions for user and group as well.

Normally a umask would subtrack from 777 for folders but 666 for files, however I find that setting the umask in a supervisor config results in the same permissions for files and folders, so when I set umask to 002, all the files uploaded get execute permissions. I also tried setting the umask to 113 but then I can't execute any folders.

I'm not 100% sure this is supervisors fault and not gevent or django related. Any ideas?

share|improve this question
add comment

1 Answer 1

I promptly discovered that django was the culprit.

After setting FILE_UPLOAD_PERMISSIONS in the django apps' settings to 0664 the umask works as expected.

ie. in settings.py:

FILE_UPLOAD_PERMISSIONS = 0664

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.