Linux - GeneralThis 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.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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
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
Note: second field denotes which run-level you want the daemon to be active in.
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
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).
Oh,.. and since named is a startup script, you'll need to follow up with "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?