Auto-heal services so a crash isn't an outage
php-fpm died at 4am, site was down till I woke up. Monit fixes that:
— apt install monit -y
— Watch a service: check process php-fpm with pidfile /run/php/php8.3-fpm.pid then if not running then restart
— Add a circuit breaker: if 5 restarts within 5 cycles then timeout — don't restart-loop a truly broken service
— Watch disk too: check filesystem rootfs with path /, alert at 85%
— Email alerts via the set mailserver block
Now a crash self-heals in under a minute. Try it tonight.
Root Access Daily
@RootAccessDaily
Auto-heal services so a crash isn't an outage
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.