Operating System - HP-UX
1831477 Members
3622 Online
110025 Solutions
New Discussion

Making default permission of App generated files

 
SOLVED
Go to solution
Sanjay Verma
Super Advisor

Making default permission of App generated files

Hi Friends,
My application generates log files which are created with '-rw-rw-rw' permissions.
I've already set my umask as - "022" but still the log files are created as "666". Can you indicate if I'm missing something somewhere?
Co-operation - The biggest chain reaction
9 REPLIES 9
Michael Tully
Honored Contributor
Solution

Re: Making default permission of App generated files

It may be dependent on the application as to whether you can control this. WIthout knowing what the application is or does, you might be able to place a 'umask setting in the application startup.

e.g.

/sbin/init.d/myapplication file starts my application. Inside it I set some variables like PATH's and umask. See if this helps. If not you have to look depper into the application, hopefully not at the binary level. If you can't find where, contact the vendor of the application.
Anyone for a Mutiny ?
Rajeev  Shukla
Honored Contributor

Re: Making default permission of App generated files

ya once you have set the umask to 022 you any files created then should have permissions -rw-r--r--
Now if this is not happening, then definately its your application which is changing the umask again to 00. I think you have a look at the application.
Also one test can be done, set umask to 022 and then run your application, exit from the application to see what umask it has got not, that will show if the umask is changed in the program or not.

Rajeev
Sanjay Verma
Super Advisor

Re: Making default permission of App generated files

Hey Michael, I've contacted the Vendor and they told it needs to be configured from Unix system only. They do not have control on the permissions of the log files generated by the application.
Co-operation - The biggest chain reaction
twang
Honored Contributor

Re: Making default permission of App generated files

what are their permissions(logon as App owner):
# touch test.touch
# echo hello > test.echo
# vi test.vi

# ll test.*
Sanjay Verma
Super Advisor

Re: Making default permission of App generated files

Hi Twang/Rajeev,
I logged in as App owner and created the files as indicated by you, the file permissions are ok "666" "-rw-r--r--".

-rw-r--r-- 1 skv skv 6 Aug 1 09:24 test.echo
-rw-r--r-- 1 skv skv 0 Aug 1 09:23 test.touch
-rw-r--r-- 1 skv skv 11 Aug 1 09:24 test.vi
Co-operation - The biggest chain reaction
Rajeev  Shukla
Honored Contributor

Re: Making default permission of App generated files

Hi Sanjay,

By loging as the application user just runs its .profile and takes what ever umask you defined.
What i mean is run the application, terminate it and then see the umask, because if its a C/perl application you can change the permission of logfiles in the application ..
Sanjay Verma
Super Advisor

Re: Making default permission of App generated files

Hey Rajeev, the application has been terminated several times but it's the same scenario.
Co-operation - The biggest chain reaction
twang
Honored Contributor

Re: Making default permission of App generated files

Does the App run any script in which has "umask"?
Do you try to run a cronjob to output something to logfile and see the logfile's permission is "666" or "644"?
Is there other App running on the problem server? If yes, how about their behavior?
Sanjay Verma
Super Advisor

Re: Making default permission of App generated files

Friends, no other script is running with any umask settings. Any expert comments?
Co-operation - The biggest chain reaction