- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Umask Question.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 07:04 AM
07-31-2002 07:04 AM
We are going to set up umask of 022 in /etc/profile But we have some applications write to /var/tmp and some to /opt/data. The files/directories under these directories should worl writable.
1. How would i achieve this
2. How are the umask for startup scripts controlled. I have particular doubt about swagentd.( i think most of them are from /sbin/rc, but some set thier own umask ...like inetd. what is the purpose of that)?
Any thoughts???
Cheers
Brian.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 07:12 AM
07-31-2002 07:12 AM
Re: Umask Question.
Your startup scripts may have a umask value in them or the application may be coded with a change of umask value in it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 07:16 AM
07-31-2002 07:16 AM
Re: Umask Question.
Each process or aplication that start's in the rc has its own shell
Set the apropiate umask for each of this in the /sbin/init.t/script
Then set the umask 022 in the /etc/profile or in the $HOME/.profile for each user that you want
Joaquin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 07:17 AM
07-31-2002 07:17 AM
Re: Umask Question.
If you know which applications (ID) need differnet UMASK, you can use IF..THEN..ELSE structure in /etc/profile do define different UMASK for different users.
You may set the UMASK in users .profile also.
Thanks.
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 07:19 AM
07-31-2002 07:19 AM
Re: Umask Question.
e.g.
savemask=$(umask 000)
echo "Test" > /var/tmp/myfile
umask $savemask #resets umask to original value
(You could also simply do a chmod after creating the file and forget about umask.)
To answer your second question, scripts set their own umasks according to their own needs. This is most often done so that no matter how tightly or loosely umask is set in /etc/profile, the application will perform as expected because umask has been overridden.
One important point is that there are two masks that need to be considered when files are created. 1) The creation mask 2) umask - which clears bits set in cmask. Man 2 creat for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 10:48 AM
07-31-2002 10:48 AM
Re: Umask Question.
Any indea how the swagentd gets it umask set for those .sw directory?? Also in clay's message i did not understand the cmask???
Thanks
Brian.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 11:03 AM
07-31-2002 11:03 AM
Re: Umask Question.
Simply put, the cmask is the "deafult" perms assigned to the file being created UNTIL the umask overrides those perms....or doesn't....whatever the case may be.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 11:09 AM
07-31-2002 11:09 AM
SolutionHi Brian:
cmask is the file's creation mask. I suggested that you do a man 2 creat to see what I'm talking about. If you really want to 'know' how something works in UNIX, look at the system calls because ultimately that's how a file creation is going to occur whether initiated from a shell script, Perl, or a COBOL/C/FORTRAN ... program.
In the shell, the default cmask for directories is 777, and for regular files it is 666. Now the bits in umask subtract from the cmask to leave the actual permissions. Have you noticed when you create shell scripts that you have to set the execute bit manually using chmod even if your umask is 000? That's because your script is a regular file and the default cmask is 666.
In C, for example, you can directly set the file's mode when you create the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 11:12 AM
07-31-2002 11:12 AM
Re: Umask Question.
strings swinstall | grep -i mask
you'll see that it uses many calls to mask functions.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 12:36 PM
07-31-2002 12:36 PM
Re: Umask Question.
But the sigprocmask and the other stuff mentioned there are quite irrelevant to umask is it not. Anyway i could not make out much from that info(strings swinstall|grep -i mask). Can you explain a little further...
Thanks
Brian.