- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Run crontab job problem
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-24-2007 05:45 PM
07-24-2007 05:45 PM
Re: Run crontab job problem
I think I have mis-understand the previous reply , the sudo works fine in my case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 06:04 PM
07-24-2007 06:04 PM
Re: Run crontab job problem
I didn't use sudo. I had a root crontab entry that executed script1. This script did "su - cron_usr". This executed /etc/profile then .profile. The .profile then executed my_script. When my_script returned, the shell finished .profile and got an immediately EOF.
Everything worked except /etc/profile also produced errors because it expects to only be executed from a terminal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 06:32 PM
07-24-2007 06:32 PM
Re: Run crontab job problem
yes , you are right , sudo is not good , if I release sudo to a user , the user have ALL function of root , if I just want a user ONLY have the permission to su another user ( on other root permission ) , what can i do ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 06:51 PM
07-24-2007 06:51 PM
Re: Run crontab job problem
This was just discussed in this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1145681
I believe this was a security issue, unless you want one specific script and that could check and su to a specific user.
But it seems to me as I keep saying, why not have a crontab entry for cron_usr?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 07:26 PM
07-24-2007 07:26 PM
Re: Run crontab job problem
why not add cron entry for cron_usr ?
> as my previous message , if run my script in cron , it is not work , but it is sucessful to run by manual , so I want to add a cron , this cron will su to another user , I check that this method is OK if run by root .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 07:37 PM
07-24-2007 07:37 PM
Re: Run crontab job problem
You need to explain or figure out why, is there an obvious error?
As has been mentioned, the obvious reason is that it needs to source .profile before or in the script.
I don't think it needs to have stdin a terminal, because that can't happen with your "su -" on cron.
- « Previous
-
- 1
- 2
- Next »