Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i have a dns2go daemon that i need to have running all the time. once in awhile it quits. how would i set it up to atomatically start everytime it stops? somebody once told me to write a script and put it in cron to detect if its running or not but i KNOW there is an easier way. mabie in the startup script?
You could run it from the mother of all processes and let it respawn when it dies. Edit the file /etc/inittab and add a line for your process. Something like:
myapp:2345:respawn:/usr/bin/myapp
First field is an id name,
second field is the runlevels (in this case 2 - 5),
third field tells it to respawn it when it dies,
fourth field is the command used to run the process.
You have to make sure you have everything configured properly for that app. Because if it gets an error and dies right away it will try to respawn it. Which can result in the error respawning too fast. Often this will prevent your system from booting. So depending on how important the daemon is, it might be better to use a cron script to make sure it's still running.
Where <dir/to/dns2go> is the directory where the dns2go executable is installed.
This cron job will attempt to start the program at the top of every hour.
If it is already running, the next invocation will do nothing.
If the program is not running, it will be started.
It works for the setiathome client. Had setiathome running for about 6months straight, before the NIC went out.
thanks for your help guys, the inittab sounds like what i was looking for, but at least i was pointed in the right direction, so i can do more research on both cron and inittab.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.