From 4e2b8dbd90d7801724058c0c6ec6a39659865376 Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 27 Oct 2018 13:23:36 +0200 Subject: [PATCH] [Watchdog] Check if initdb is running and if true skip killing php-fpm-mailcow --- data/Dockerfiles/watchdog/watchdog.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/data/Dockerfiles/watchdog/watchdog.sh b/data/Dockerfiles/watchdog/watchdog.sh index ccb88c67..7f8e0ad4 100755 --- a/data/Dockerfiles/watchdog/watchdog.sh +++ b/data/Dockerfiles/watchdog/watchdog.sh @@ -317,7 +317,6 @@ Empty while true; do if ! nginx_checks; then log_msg "Nginx hit error limit" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "nginx-mailcow" echo nginx-mailcow > /tmp/com_pipe fi done @@ -328,7 +327,6 @@ BACKGROUND_TASKS+=($!) while true; do if ! mysql_checks; then log_msg "MySQL hit error limit" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "mysql-mailcow" echo mysql-mailcow > /tmp/com_pipe fi done @@ -339,7 +337,6 @@ BACKGROUND_TASKS+=($!) while true; do if ! phpfpm_checks; then log_msg "PHP-FPM hit error limit" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "php-fpm-mailcow" echo php-fpm-mailcow > /tmp/com_pipe fi done @@ -350,7 +347,6 @@ BACKGROUND_TASKS+=($!) while true; do if ! sogo_checks; then log_msg "SOGo hit error limit" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "sogo-mailcow" echo sogo-mailcow > /tmp/com_pipe fi done @@ -362,7 +358,6 @@ if [ ${CHECK_UNBOUND} -eq 1 ]; then while true; do if ! unbound_checks; then log_msg "Unbound hit error limit" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "unbound-mailcow" echo unbound-mailcow > /tmp/com_pipe fi done @@ -375,7 +370,6 @@ if [[ "${SKIP_CLAMD}" =~ ^([nN][oO]|[nN])+$ ]]; then while true; do if ! clamd_checks; then log_msg "Clamd hit error limit" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "clamd-mailcow" echo clamd-mailcow > /tmp/com_pipe fi done @@ -387,7 +381,6 @@ fi while true; do if ! postfix_checks; then log_msg "Postfix hit error limit" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "postfix-mailcow" echo postfix-mailcow > /tmp/com_pipe fi done @@ -398,7 +391,6 @@ BACKGROUND_TASKS+=($!) while true; do if ! dovecot_checks; then log_msg "Dovecot hit error limit" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "dovecot-mailcow" echo dovecot-mailcow > /tmp/com_pipe fi done @@ -409,7 +401,6 @@ BACKGROUND_TASKS+=($!) while true; do if ! rspamd_checks; then log_msg "Rspamd hit error limit" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "rspamd-mailcow" echo rspamd-mailcow > /tmp/com_pipe fi done @@ -448,17 +439,27 @@ done # Restart container when threshold limit reached while true; do CONTAINER_ID= + HAS_INITDB= read com_pipe_answer