LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 06-20-2001, 04:51 AM   #1
Nezar
Member
 
Registered: May 2001
Posts: 63

Rep: Reputation: 15
Automatic Restart


I have an certain daemon that sometimes shutdown it self without any reason!
Can I make certain thing to automatically restart this application after it shutdown?
If yes, then how?
 
Old 06-20-2001, 05:17 AM   #2
Marcel
LQ Newbie
 
Registered: Jun 2001
Posts: 7

Rep: Reputation: 0
I didn't really understand our post but,
a simple "reboot" in the console will reboot the system.
Are you crashing? Are you sure the deamon reboots?
 
Old 06-20-2001, 05:40 AM   #3
Danish Usman
LQ Newbie
 
Registered: Jun 2001
Posts: 4

Rep: Reputation: 0
Automatic Restarting Services

Dear

u must write a shell script that monitor your specified service
or deamon either it is running or not if it is stopped then restart it
again and put this script in crown job run it every after 1 minute

Regards


Danish Usman
 
Old 06-21-2001, 06:17 AM   #4
Nezar
Member
 
Registered: May 2001
Posts: 63

Original Poster
Rep: Reputation: 15
Comment !

To be precise, the daemon stops it self arbitrarly. How to restart it automatically. (i,e, some controls ....).
 
Old 06-21-2001, 07:38 AM   #5
hazza96
Member
 
Registered: Apr 2001
Location: Brisbane, Australia
Distribution: Ubuntu
Posts: 146

Rep: Reputation: 15
Quote:
To be precise, the daemon stops it self arbitrarly. How to restart it automatically. (i,e, some controls ....).
Which daemon?

Maybe we can help to find out why that particular daemon is stopping. That's the difference between a solution and a workaround.

Maybe the daemon is supposed to stop after a period of time? How are you checking that the daemon is stopped? What distro have you got?
 
Old 06-22-2001, 04:17 AM   #6
Nezar
Member
 
Registered: May 2001
Posts: 63

Original Poster
Rep: Reputation: 15
Hi,

The daemon is NAMED

Thanks,
 
Old 09-23-2003, 11:47 PM   #7
christopherccv
Member
 
Registered: Jul 2003
Location: malaysia
Distribution: redhat
Posts: 31

Rep: Reputation: 15
Dear Nezar and Harry,

may i know weather can have have the solution for what have you discuss long time ago regarding the script for the named service to be automatic restart when is fail.

Thanks

Christopher
 
Old 09-24-2003, 02:50 AM   #8
shawnchin
LQ Newbie
 
Registered: Sep 2003
Location: Malaysia
Distribution: Redhat, Gentoo
Posts: 18

Rep: Reputation: 0
If you want a deamon to restart automatically whenever it dies, you can get the use of our best friend, INIT.

We can do this by adding an entry in /etc/inittab
Just like how your login prompt respawns everytime you're logged out and ended the session, we can use the respawn directive to respawn any daemon that dies.

Use and entry as such
# in /etc/inittab
c1:345:respawn:/path/to/my/daemon


Note: second field denotes which run-level you want the daemon to be active in.


Cheers
 
Old 09-24-2003, 03:05 AM   #9
christopherccv
Member
 
Registered: Jul 2003
Location: malaysia
Distribution: redhat
Posts: 31

Rep: Reputation: 15
Dear Shawnchin

thanks for your reply.

the c1 stand for the tty is it? by default one should be 1. mean i can put from 1 to 5. correct?

what i should have is :

1:2345:respawn:/etc/init.d/named

is this correct?
 
Old 09-24-2003, 03:20 AM   #10
shawnchin
LQ Newbie
 
Registered: Sep 2003
Location: Malaysia
Distribution: Redhat, Gentoo
Posts: 18

Rep: Reputation: 0
c1, or the first field to be exact, is for ID. Just a unique identifier for that entry. Not associated to any TTY, unless you are running a Login Process, for which u put in the related TTY (required for login accounting).

From man inittab
Quote:
id is a unique sequence of 1-4 characters which identifies an entry in inittab (for versions of sysvinit compiled with libraries < 5.2.18 or a.out libraries the limit is 2 characters).
 
Old 09-24-2003, 03:24 AM   #11
shawnchin
LQ Newbie
 
Registered: Sep 2003
Location: Malaysia
Distribution: Redhat, Gentoo
Posts: 18

Rep: Reputation: 0
Oh,.. and since named is a startup script, you'll need to follow up with "start":
/etc/init.d/named start

respawning thru INIT is usually used for daemons that are not called thru the start-stop daemon (like some installations of Oracle), so i'm not too sure if it will work for named, but you could give it a try i guess.


Perhaps a more permanent solution would be to figure out why your named shuts down for no particular reason, and fix that instead?
 
Old 09-24-2003, 04:21 AM   #12
christopherccv
Member
 
Registered: Jul 2003
Location: malaysia
Distribution: redhat
Posts: 31

Rep: Reputation: 15
thanks for your reply. i will test it out.

i still looking into the problem why the named service keep on fail when it run quite some time.

thank you
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
automatic refresh nanoprobe Linux - General 2 07-11-2005 10:24 AM
Automatic Restart of a failed Service in Linux psychguy Linux - Software 5 05-07-2005 07:53 PM
Automatic restart cmgleipzig Linux - Newbie 6 07-15-2004 12:44 AM
Automatic restart redhat linux 8.0 poorni Linux - Hardware 1 08-05-2003 02:40 PM
RH 7.2 Automatic Logout alanlq Linux - General 4 09-05-2002 03:38 PM


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