LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices

Reply
 
LinkBack Search this Thread
Old 11-30-2011, 01:11 AM   #1
memmy
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Rep: Reputation: 0
stop script after 5 min.


hello
i have Oracle APPS installed on AIX 6.1 machine.
i need to make script runs before shutdown to stop oracle apps server automatically.
i know that i can write my stop script in /etc/rc.shutdown but i want this script stop if it take more than 4 minutes.
any command can do that
i tried sleep but didn't work for me the shutdown process still wait for the rc.shutdown script finished
i need to know how to stop the script after specific time even the script didn't completed successfully.

Thanks and Best regards,
 
Old 11-30-2011, 03:20 AM   #2
0rphu
LQ Newbie
 
Registered: Sep 2009
Posts: 27

Rep: Reputation: 6
Hi,

try placing the script somewhere else and just execute it in the background from within the rc.shutdown, put sleep in rc.shutdown after that.

something like
Code:
#!/usr/bin/ksh
print "script1 started"
/root/script2 &
sleep 30
print "script 1 ended"
 
Old 12-04-2011, 06:36 AM   #3
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,007

Rep: Reputation: 81
Assuming your shutdown process is something like:

Code:
$ORACLE_HOME/opmn/bin/opmnctl stopall
echo "shutdown"|sqlplus '/ as sysdba'
lsnrctl stop
Have you tried running the script outside of the server shutdown process? Where does it get stuck?

This script would need to run as the oracle account, server shutdown scripts will run as root so that may be part of the issue.
 
Old 12-04-2011, 07:47 AM   #4
David the H.
Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 5,319

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
The gnu coreutils include an application called timeout that will stop a process (or send it a user-defined signal) after a set length of time. There's also a separate project called timelimit that works similarly.
 
Old 12-04-2011, 11:22 PM   #5
memmy
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Original Poster
Rep: Reputation: 0
thanks

thanks alot guys for your help.
it works for me.
I used sleep command and works fine. you must put your stop script on another place.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slack script to take a min install and make it usable, is it possible? AuroraZero Slackware 6 10-05-2011 06:16 PM
[SOLVED] From 2 days ago, it takes 10 min.s to boot my HP dv9700 laptop. Prior two yr.s, 2 min PTrenholme Linux - Hardware 6 12-28-2010 11:40 AM
3.8 Gb Suse 10.1 slow install in 1h30 min. Mandriva 2006 was less than 40 min Emmanuel_uk Linux - Distributions 2 06-15-2006 09:27 AM
Internet connection work for 5 min get slow and stop ftwilliam Linux - Networking 33 03-20-2006 06:43 PM


All times are GMT -5. The time now is 07:06 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration