- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: default umask for cron
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
Discussions
Discussions
Discussions
Forums
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
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
тАО04-30-2008 08:14 AM
тАО04-30-2008 08:14 AM
default umask for cron
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2008 08:23 AM
тАО04-30-2008 08:23 AM
Re: default umask for cron
If you want a specific umask in your cron scripts you need to set it manually in the scripts themselves.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2008 08:28 AM
тАО04-30-2008 08:28 AM
Re: default umask for cron
Perhaps the better question is: where is cron getting its umask?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2008 10:00 PM
тАО04-30-2008 10:00 PM
Re: default umask for cron
You should just set umask the way you want it in your scripts as Patrick said.
Otherwise cron is started from rc, which is started from inittab.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2008 10:29 PM
тАО04-30-2008 10:29 PM
Re: default umask for cron
Patrick is absolutely right when he says cron does not refer any .profile file,you have to put in cron script.
Dennis
>Otherwise cron is started from rc, which is started from inittab
Lis question is if he is running touch from cron entry file has permission 644.
So from where this permission is coming.
I think its the default one 022 as said by Dennis.Cron start from rc.
When u change umask for root or someone from .profile it would be effective only for that login.
BR,
Kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2008 10:45 PM
тАО04-30-2008 10:45 PM
Re: default umask for cron
and I think cron should take default from this only.
Can you please check once again entries you have in /etc/profile.
BR,
Kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2008 10:58 PM
тАО04-30-2008 10:58 PM
Re: default umask for cron
Why? You said exactly what umask was, 022. This is hardcoded in /sbin/rc.
And that matches with what Luis said touch did.
>default mask should come from /etc/profile
But it gets reset by rc(1m).
>I think cron should take default from this only.
No, cron gets it from rc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2008 11:30 PM
тАО04-30-2008 11:30 PM
Re: default umask for cron
rc > /etc/profile > HOME/.profile
if /etc/profile and HOME/.profile does not have any specified umask then default would come from rc.
Right...
Kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2008 11:55 PM
тАО04-30-2008 11:55 PM
Re: default umask for cron
>rc > /etc/profile > HOME/.profile
Why?
It moves like: maybe /etc/profile > HOME/.profile
rc > umask 022 > /sbin/rc.utils, rc.config
>> rc scripts
>if /etc/profile and HOME/.profile
Why would these be looked at after rc starts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2008 06:34 AM
тАО05-01-2008 06:34 AM
Re: default umask for cron
"if /etc/profile and HOME/.profile does not have any specified umask then default would come from rc.
Right..."
and cron *doesn't* login, so it doesn't use the profiles....which is why its set to the default....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2008 08:08 AM
тАО05-01-2008 08:08 AM
Re: default umask for cron
So it would seem that making the change in /etc/profile would not imnpact cron jobs. Now the admin in me wants to provide further comfort to the app teams, and state that the cron umask is controlled by [fill in answer here]. I thought /sbin/rc was it, but I changed it on a test server, rebooted, and my "test touch" entry still had 022 (rw-r--r--) (yes, I removed the file prior to the test). I started researching the .proto file in /var/adm/cron, but the umask there is a variable ($m). 10 points for the answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2008 08:44 AM
тАО05-01-2008 08:44 AM
Re: default umask for cron
Yes, see the 'proto(4)' manpages for more details.
You can alter the 'cron' or 'at' task's umask as demonstrated below. In these cases, I let the output be mailed to the account originator:
# cat /tmp/mything
#/usr/bin/sh
echo ok
umask
# umask 077;at -f /tmp/mything 1236
[mail result was]
ok
077
# crontab -l
37 * * * * umask 077 && /tmp/mything
[mail result was]
ok
077
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2008 01:10 PM
тАО05-01-2008 01:10 PM
Re: default umask for cron
Ah, it is hardcoded in cron(1).
>JRF: see the 'proto(4)' manpages for more details.
It seems proto(4) is only for at/batch.