From f3edcf9cd5f2f3f5601b2c3f09a6434fc8d477c6 Mon Sep 17 00:00:00 2001 From: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com> Date: Wed, 1 Mar 2023 16:33:54 +0100 Subject: [PATCH] issue warning in case of improper restart (#3129) --- docs/content/usage.md | 2 ++ target/scripts/start-mailserver.sh | 1 + target/scripts/startup/check-stack.sh | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/docs/content/usage.md b/docs/content/usage.md index 377e50bb..4ece264c 100644 --- a/docs/content/usage.md +++ b/docs/content/usage.md @@ -58,6 +58,8 @@ chmod a+x ./setup.sh **Use `docker compose up / down`, not `docker compose start / stop`**. Otherwise, the container is not properly destroyed and you may experience problems during startup because of inconsistent state. + Using `Ctrl+C` **is not supported either**! + You are able to get a full overview of how the configuration works by either running: 1. `./setup.sh help` which includes the options of `setup.sh`. diff --git a/target/scripts/start-mailserver.sh b/target/scripts/start-mailserver.sh index 2cf87b11..596e1a21 100755 --- a/target/scripts/start-mailserver.sh +++ b/target/scripts/start-mailserver.sh @@ -33,6 +33,7 @@ function _register_functions # ? >> Checks + _register_check_function '_check_improper_restart' _register_check_function '_check_hostname' _register_check_function '_check_log_level' diff --git a/target/scripts/startup/check-stack.sh b/target/scripts/startup/check-stack.sh index 4afe0af0..301e1079 100644 --- a/target/scripts/startup/check-stack.sh +++ b/target/scripts/startup/check-stack.sh @@ -17,6 +17,17 @@ function _check done } +function _check_improper_restart +{ + _log 'debug' 'Checking for improper restart' + + if [[ -f /CONTAINER_START ]] + then + _log 'warn' 'This container was (likely) improperly restarted which can result in undefined behavior' + _log 'warn' 'Please destroy the container properly and then start DMS again' + fi +} + function _check_hostname { _log 'debug' 'Checking that hostname/domainname is provided or overridden'