- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Timeout on a script
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
08-19-2009 11:23 AM
08-19-2009 11:23 AM
Question: How would I put a timeout on the script, so if the 'stop' script has run for 5-10 minutes, I want the control back? I can take appropriate action.
Thanks!
Ravi.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2009 11:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2009 11:29 AM
08-19-2009 11:29 AM
Re: Timeout on a script
totally overlooked.
assigning points.
Thanks!
Ravi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2009 07:00 AM
08-20-2009 07:00 AM
Re: Timeout on a script
handing the control back would be just a workaround, i would prefer clear it what is the hard part by stopping the processes.
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2009 11:28 PM
08-20-2009 11:28 PM
Re: Timeout on a script
# man timeout
So you need a trick as a sleep command and kill process you want ,like this clause:
SetTimer() {
DEF_TOUT=${1:-10};
if [ $DEF_TOUT -ne 0 ] ; then
sleep $DEF_TOUT && kill -s 14 $$ &
CHPROCIDS="$CHPROCIDS $!"
TIMERPROC=$!
fi
}
after 10 sec. it will issue a sleep command with a timeout and use the kill command to send the shell's process ID (stored in $$)