LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-07-2004, 09:27 AM   #1
st3reo
Member
 
Registered: Nov 2004
Location: East Side
Distribution: Red Hat
Posts: 49

Rep: Reputation: 15
auto restart service


Hi,

How can I set it to automaticly restart a service if it dies?
Because I have a service that from time to time dies out and I want it to be warking at all times.
I am running a red hat box.
Can anyone help me?

Thanks,
 
Old 12-07-2004, 10:23 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Write a script that checks to see if the process is running, if its not, have the script restart it.. place this script as a cron job that runs every 5 minutes.. or every hour.. or whatever you desire..
 
Old 12-07-2004, 10:30 AM   #3
st3reo
Member
 
Registered: Nov 2004
Location: East Side
Distribution: Red Hat
Posts: 49

Original Poster
Rep: Reputation: 15
Unhappy

ok thanks for the info,

the only problem is I don't really know much about making scripts
 
Old 12-07-2004, 12:37 PM   #4
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
Run it from /etc/inittab with the action respawn. See man inittab.
 
Old 12-07-2004, 01:46 PM   #5
st3reo
Member
 
Registered: Nov 2004
Location: East Side
Distribution: Red Hat
Posts: 49

Original Poster
Rep: Reputation: 15
hey,

I`ve been doing some reading in man, but I'm still not sure how the line in inittab should look
If for example the service was called "service" and you start it by /etc/init.d/service start
what would I add to inittab?

Thanks,
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Service to auto restart jamiehenderson Linux - Software 3 08-08-2005 02:44 PM
Automatically Restart Service tulip4heaven Linux - General 1 04-23-2005 03:11 AM
How to restart a service in slackware? echojihui Slackware 7 08-31-2004 09:03 PM
service network restart perry Linux - Networking 2 12-15-2003 08:00 AM
Auto-login and auto-restart... TankerKevo Red Hat 2 10-04-2003 08:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration