LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Delay startup script until 15 minutes after boot... (https://www.linuxquestions.org/questions/linux-server-73/delay-startup-script-until-15-minutes-after-boot-661245/)

ddenton 08-07-2008 03:54 PM

Delay startup script until 15 minutes after boot...
 
I've got an RHEL 4 server running oracle 10g, and I need to the enterprise manager console 10-15 minutes after the server starts. Oracle itself is started automatically, and takes some time to spin up, and I'd like the dbconsole to start automatically, but am not sure how oracle would react if the dbconsole starts while the database instances are starting.

Can anyone give me a tip on how to start an init script or command, just once, after a certain period of time has elapsed? If there's also a way to automate the starting of the dbconsole automatically, I'm open to ideas on that as well.

Thanks in advance...

arizonagroovejet 08-07-2008 04:29 PM

How about just calling a script at boot the first line of which is

Code:

sleep 900
900 seconds being 15 minutes. You'd have to put the script in to the background of course else the boot sequence would just for 15 minutes.

ddenton 08-07-2008 04:37 PM

I thought sleep in an init script would impact other scripts. Thanks, I'll give sending it to the background a shot...

billymayday 08-07-2008 04:42 PM

You could also use the "at" command to run a script at some arbitrary time into the future

Code:

at now + 15 minutes -f your_script

chrism01 08-07-2008 08:49 PM

On RH systems, the last script called is

/etc/rc.local

which is there for exactly this sort of customized startup.

ddenton 08-12-2008 02:07 PM

Thanks all for the replies! I'm using a script to set some variables and start OEM, and using rc.local and "at" to launch it 15 minutes after startup...

chrism01 08-12-2008 08:16 PM

Alternately, use a script, whose first line is

sleep 900

and start it from rc.local like this

nohup /path/myscript &

which will disconnect it from the startup and background it.


All times are GMT -5. The time now is 07:33 PM.