LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-13-2004, 01:50 PM   #1
Jakeh2k1
LQ Newbie
 
Registered: Oct 2004
Posts: 20

Rep: Reputation: 0
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
 
Old 11-13-2004, 02:02 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting a Script from rc.local dazz Linux - Newbie 9 07-03-2005 05:03 AM
starting script on startup darklandz Linux - Newbie 4 06-05-2005 02:51 AM
Starting Firefox (script that just works) Halcyon-X Linux - General 11 08-26-2004 09:31 PM
starting a script on boot jax8 Linux - Newbie 1 03-19-2004 10:38 PM
Starting Script on startup chrisfirestar Linux - General 5 12-02-2003 12:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration