Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a programm which creates log files in web-server directory (/var/www/log). Every day it generates one new log file. I've set access permissions for this directory to 777

chmod 777 -R /var/www/log

But when system generates log file for new day, it doesn't have access permissions 777. I have to do it manually again. How can I correctly set permissions for directory? All files in this directory must have 777 automatically.

share|improve this question
4  
Why would a log directory ever need god mode? –  nerdwaller Nov 25 '13 at 20:54
    
Can you have to logs go elsewhere? Like the home directory? –  Kruug Nov 25 '13 at 21:18
3  
Why give log files execute permissions? –  Roland Smith Nov 25 '13 at 21:19

1 Answer 1

up vote 3 down vote accepted

The access permissions on a directory do not determine the access permissions for a file in that directory in Linux; they are not inherited.

Either change the umask(2) of the program that writes the logfiles, or change the settings of the program that rotates the logfiles.

share|improve this answer

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.