LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Starting Script (https://www.linuxquestions.org/questions/linux-general-1/starting-script-254418/)

Jakeh2k1 11-13-2004 01:50 PM

Starting Script
 
Hi All,

Im running a server on RedHat 9,

Does anyone know how i'd go about getting a small script to restart certain programs when they crash, and also start straight away when the server reboots / starts up.


Thanks,


Jakeh

david_ross 11-13-2004 02:02 PM

To get something to run on startup the easiest way is just to add the command to /etc/rc.local but if it is a complex proccess then you may want to create a seperate startup script.

To keep a proccess alive there are a few ways.
1) A script like "while [ 1 ];do somecommand;done"
2) You could add a line to /etc/inittab
3) The best and most stable solution would be to use daemontools:
http://cr.yp.to/daemontools.html


All times are GMT -5. The time now is 09:54 PM.