Существует ли Linux-служба для просмотра / проверки (и перезапуска, т. Е.для segfault) запущенные демоны? [закрыто]

Я ищу службу linux, которая каждые n секунд просматривает / проверяет список запущенных процессов / демонов для обнаружения (и замечая + перезапуск процесса) любых проблем (например, ошибки сегментации в nginx).

Есть ли там любой?

0
задан 2 October 2012 в 18:50
2 ответа

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

3
ответ дан 4 December 2019 в 11:56

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).

1
ответ дан 4 December 2019 в 11:56

Теги

Похожие вопросы