Operating System - HP-UX
1834757 Members
2893 Online
110070 Solutions
New Discussion

Re: How to force file permission of new files under certain directory

 
yyghp
Super Advisor

How to force file permission of new files under certain directory

I have a directory called /logs, which contains logs of application running by different users, like app.log.1, app.log.2, ...etc. no matter which user runs that application, such user can write/extend logs to the current log file, and will create a new log when the log file is filled up to 1MB. But the problem is that the application generate the log file with "-rw-r--r--" by default, with the owner who first creates that log file, then others can't extend that log file because no write permission.
How can I force the application generate the file with permission like "-rw-rw-rw-" ? or How can I force all new files to be "-rw-rw-rw-" under a certain directory?
Can ACL help?
Thanks!
5 REPLIES 5
harry d brown jr
Honored Contributor

Re: How to force file permission of new files under certain directory

what is the UMASK of the users?

Are the USERS in the same group?

live free or die
harry d brown jr
Live Free or Die
Pedro Cirne
Esteemed Contributor

Re: How to force file permission of new files under certain directory

Hi,

Use the command umask:

umask u=rw,g=rw,o=rw~

See man umask for details

Enjoy :-)
yyghp
Super Advisor

Re: How to force file permission of new files under certain directory

no umask for those users now, does UMASK help ? Since the application (run by different users) generates the log files...

yes, same group
harry d brown jr
Honored Contributor

Re: How to force file permission of new files under certain directory

Something is changing the umask from a DEFAULT of 000 to 022.

Check /etc/profile and user .profile files and any other login scripts (.kshrc, ...) for the "umask" command.

have a "nromal" user login, go to a command shell prompt and type in

umask -S

to see what the umask is set to. If it is indeed 000, then it could be your applciation that is messing with the permissions.

live free or die
harry d brown jr
Live Free or Die
yyghp
Super Advisor

Re: How to force file permission of new files under certain directory

close