Link to home
Start Free TrialLog in
Avatar of enthuguy
enthuguyFlag for Australia

asked on

Setting up auto-startup when OS starts up or reboot on Linux

Hi,

Would like to configure auto-startup on few process on linux OS. Could you suggest detailed steps please

Scenario is, I have few applications running on Linux which has dependencies between them (Parent, child, grand child). So when OS reboots/starts....would like to
1. start  parent app first
2 wait for parent to be running, then start child app
3 wait for child to be running, then start grand-child app.

Also similar for graceful shutdown

Thanks in advance
Avatar of farzanj
farzanj
Flag of Canada image

What is your Linux distro?

You have to create a /etc/rc.d kind of script.  This would start it in the order you mentioned.  Will also shut in the correct order.
SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Once you create the script and run it successfully as per your wishes, you will have to add a symlink of it in the folder of your run level like rc3.d or rc5.d.  This is done with a simple command but that command is different with different distributions.
Avatar of enthuguy

ASKER

Hi Farzanj, Thanks for your quick comment.

To be precise...I run Oracle Enterprise Linux 5.x

Above sample script would work for me?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It should work for you.  If you include all the three processes in the same startup script, you will have the control over the start and end order of processes.
Avatar of xterm
xterm

Sorry, grandchild app should have:

   chkconfig: 2345 57 23

You get the idea though :)
Awesome!!