Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm searching for a linux service that watches/checks every n seconds a list of running processes/daemons for detecting (and noticing+restarting the process) any issues (like a segmentation fault in nginx).

Is there any?

share|improve this question

closed as not constructive by ewwhite, Tim Brigham, Ward, Michael Hampton, Scott Pack Oct 5 '12 at 0:17

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Monit is a common choice for this. However, it is also very well-documented here.. Try checking the existing Monit questions to see if any fit your use-case. –  ewwhite Oct 2 '12 at 15:54

2 Answers 2

up vote 3 down vote accepted

You can try monit. It can do more than just monitoring processes though which shouldn't be a problem I guess.

share|improve this answer

There are several. They're called watchdogs

DJB's daemontools does this (but it's icky. I'm not even giving you a link.)

There are also various examples of watchdog scripts people have written (this one is pretty decent) - usually it's a shell script that reads a PID file, checks to see if the corresponding PID is alive, and either notifies you or restarts the affected service if it's not.
They're typically run out of cron jobs every minute/5 minutes/ etc. - tighter granularity than that is almost never necessary in the real world.

If you have a proper monitoring system in place you can often hook your monitoring system so alerts go to a handler script that tries to restart services that are down (but beware the negative impact of false alarms here - restarting your webserver when you don't need to could cause more harm than good).

share|improve this answer
1  
I quite like upstart. –  Tom O'Connor Oct 2 '12 at 15:56
    
Upstart is supposed to be pretty good, and comes with modern Ubuntu (and Debian?) which is a bonus. I haven't worked with it much personally. –  voretaq7 Oct 2 '12 at 16:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.