Set permissions for new files created by application

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Set permissions for new files created by application
# 1  
Old 02-04-2013
Set permissions for new files created by application

Hello All,
I have an application that creates the log files and they created with 600 permissions instead of 644(default). How can I set the permissions so that files can be created with 644. I looked into the /etc/profile for the umask settings and it is set 002(if UID>199). And when I type umask I get "0022". Also permissions are resetting to 600 on log rotation if I change the permission to 644 manually.
I just tried, when I login with root and create file manually, it creates with 644. Could some one help me out. I wanted to create the files with 644 and shouldn't change. Thanks.
# 2  
Old 02-04-2013
If your umask is set to 022 and files you create are being set to mode 644, then the application you're calling either sets a different umask before creating files or chmod()'s permissions on the files after it creates them. To change this, you'll have to change the application.
# 3  
Old 02-04-2013
Thanks for your response Don, As I'm not sure if I could change the application, is there any other way that I can setup so that files can be created with 644. Thanks.
# 4  
Old 02-04-2013
Not really, no. You can't force the FS to use different permissions than what the application is asking for.

What is your application?
# 5  
Old 02-04-2013
thats custom java application.
so the only way is to have cron job to run every 5mins or so??
Thanks
# 6  
Old 02-04-2013
Quote:
Originally Posted by s_linux
Thanks for your response Don, As I'm not sure if I could change the application, is there any other way that I can setup so that files can be created with 644. Thanks.
If you know the name of the file that the application will create, you could move the application to an alternative location and replace it by a script that will call the moved application and then change the mode of the file it creates. (This probably only works if the name of the file to be created is passed to the application as one of its operands.)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Set ACL permissions Solaris

I want to set ACL permissions using this command in solaris 10 , but I get an error message. server# mkdir dir1 server# setfacl -m user:allan:rwx dir1 setacl error: Operation not applicable Any one can help in this matter. Please use CODE tags as required by forum rules! (2 Replies)
Discussion started by: AbuAliiiiiiiiii
2 Replies

2. UNIX for Dummies Questions & Answers

To set different file permissions for different users of same group

Hi, If User1, User2 and User3 are in the same group. User1 should not be able to view the files of User2 and User3. But User2 and User3 should be able to view all files. How to set permission for this. Please help. Thanks, Priya. (1 Reply)
Discussion started by: banupriyat
1 Replies

3. SuSE

How to set permissions for files which get rolled over?

Hi, One application that I have generates log files into a specific folder in SUSE. When the size of the log file reaches 50 MB, it gets rolled over and it is stored as testlog_1.log and the new events are logged in testlog.log When I set a chmod -R 744 on the directory of these logs, it... (4 Replies)
Discussion started by: graosn
4 Replies

4. Shell Programming and Scripting

Finding compound words from a set of files from another set of files

Hi All, I am completely stuck here. I have a set of files (with names A.txt, B.txt until L.txt) which contain words like these: computer random access memory computer networking mouse terminal windows All the files from A.txt to L.txt have the same format i.e. complete words in... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

5. Ubuntu

Help, I created a permissions disaster with chown

Ubuntu 10.04, Drupal 7.0 :wall: I created a Linux instance on Amazon AWS using a bitnami Linux image, and had a website up and running using Drupal. Coming from a Windows background I wanted to use a GUI to manage files because it is much faster for me, I got Gnome running on TightVNC by... (4 Replies)
Discussion started by: alterego55
4 Replies

6. UNIX for Dummies Questions & Answers

Creating a File system with required permissions for all DIR's created in

Hello All, I am application admin. I need to clear all the temporary files cleared by the applications. I need help/suggestion that is there any way to create a file system such that every Dir created in by any user will have 775 permissions. So, that i can simply clear the temporary file which... (6 Replies)
Discussion started by: firestar
6 Replies

7. UNIX for Advanced & Expert Users

files created with different permissions

Hi, Within a SQL file i am calling 5 shell scripts in back ground and redirecting their outputs to different log files in a specific directory. Now when I observed is, the log files are created with different permissions even though i did not do any thing specific. For example in... (2 Replies)
Discussion started by: steria_learner
2 Replies

8. Shell Programming and Scripting

Can is set permissions temporarily?

I want to do just what the title says. Here's why: I am adapting a script that backups to a mount. In the script it has a catch where if the drive isn't RW then it unmounts and attempts to remount RW. # attempt to remount the RW mount point as RW; else abort $MOUNT -o remount,rw... (3 Replies)
Discussion started by: Movomito
3 Replies

9. UNIX for Dummies Questions & Answers

Newly created files default group and write permissions

Whenever I create a new file the group name is "dnn" and the file permissions are "-rw-r--r--". How do I get it so when I create files (with vi or other programs) that the default group is "sss" and the permissions are 770? (I am running HP-UNIX) Thanks, GoldFish (2 Replies)
Discussion started by: goldfish
2 Replies

10. UNIX for Dummies Questions & Answers

new directory - how to force files created in it to inherit grp,own and permissions

Hi, I'm new to unix -solaris. I've just upgraded a third party software product and am testing it to see if new files created in a test database directory were being created properly and they aren't. They're owned by the user that created the file, instead of poppa and the group of their files... (2 Replies)
Discussion started by: avisb
2 Replies
Login or Register to Ask a Question