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? |
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? |
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 |
Comment !
To be precise, the daemon stops it self arbitrarly. How to restart it automatically. (i,e, some controls ....).
|
Quote:
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? |
Hi,
The daemon is NAMED Thanks, |
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 |
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 |
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? |
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:
|
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? |
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 |
All times are GMT -5. The time now is 05:06 AM. |