From d447f61af775740d76354ddca630c5bbc207d6a1 Mon Sep 17 00:00:00 2001 From: "dave@tiredofit.ca" Date: Wed, 27 Jul 2022 12:06:59 -0700 Subject: [PATCH] Release 7.6.27 - See CHANGELOG.md --- CHANGELOG.md | 6 ++++++ README.md | 18 ++++++++++-------- install/assets/defaults/00-container | 1 + install/assets/functions/00-container | 15 +++++++++------ 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 687f74f..4ee7e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.6.27 2022-07-27 + + ### Added + - Add option to show application output on the final execution before the process runaway guard is activated + + ## 7.6.26 2022-07-27 ### Changed diff --git a/README.md b/README.md index f7c564f..39a76ff 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,7 @@ This image includes the capability of using agents inside the image to monitor m | ----------------------------- | -------------------------------------------- | -------- | | `CONTAINER_ENABLE_MONITORING` | Enable Monitoring of applications or metrics | `TRUE` | | `CONTAINR_MONITORING_BACKEND` | What monitoring agent to use `zabbix` | `zabbix` | + ##### Zabbix Options This image comes with Zabbix Agent 1 (Classic or C compiled) and Zabbix Agent 2 (Modern, or Go compiled). See which variables work for each version and make your agent choice. Drop files in `/etc/zabbix/zabbix_agentd.conf.d` to setup your metrics. The environment variables below only affect the system end of the configuration. If you wish to use your own system configuration without these variables, change `ZABBIX_SETUP_TYPE` to `MANUAL` @@ -363,14 +364,15 @@ e.g: `2021-07-01 23:01:04 04-scheduling 2 container` Use the values in your own bash script using the `$1` `$2` `$3` `$4` `$5` syntax. Change time and date and settings with these environment variables -| Parameter | Description | Default | -| ------------------------------------- | ------------------------------------------------------------ | ---------------------------------- | -| `CONTAINER_PROCESS_HELPER_PATH` | Path to file external helper scripts | `/assets/container/processhelper/` | -| `CONTAINER_PROCESS_HELPER_SCRIPT` | Default helper script name | `processhelper.sh` | -| `CONTAINER_PROCESS_HELPER_DATE_FMT` | Date format passed to external script | `%Y-%m-%d` | -| `CONTAINER_PROCESS_HELPER_TIME_FMT` | Time format passed to external script | `%H:%M:%S` | -| `CONTAINER_PROCESS_RUNAWAY_PROTECTOR` | Disables a service if executed more than (x) amount of times | `TRUE` | -| `CONTAINER_PROCESS_RUNAWAY_LIMIT` | Disables a service if executed more than (x) amount of times | `50` | +| Parameter | Description | Default | +| --------------------------------------------- | --------------------------------------------------------------- | ---------------------------------- | +| `CONTAINER_PROCESS_HELPER_PATH` | Path to file external helper scripts | `/assets/container/processhelper/` | +| `CONTAINER_PROCESS_HELPER_SCRIPT` | Default helper script name | `processhelper.sh` | +| `CONTAINER_PROCESS_HELPER_DATE_FMT` | Date format passed to external script | `%Y-%m-%d` | +| `CONTAINER_PROCESS_HELPER_TIME_FMT` | Time format passed to external script | `%H:%M:%S` | +| `CONTAINER_PROCESS_RUNAWAY_PROTECTOR` | Disables a service if executed more than (x) amount of times | `TRUE` | +| `CONTAINER_PROCESS_RUNAWAY_LIMIT` | The amount of times it needs to restart before disabling | `50` | +| `CONTAINER_PROCESS_RUNAWAY_SHOW_OUTPUT_FINAL` | Show the program Output on the final execution before disabling | `TRUE` | ### Networking diff --git a/install/assets/defaults/00-container b/install/assets/defaults/00-container index 100985d..d4f263b 100755 --- a/install/assets/defaults/00-container +++ b/install/assets/defaults/00-container @@ -34,6 +34,7 @@ CONTAINER_PROCESS_HELPER_SCRIPT=${CONTAINER_PROCESS_HELPER_SCRIPT:-"processhelpe CONTAINER_PROCESS_HELPER_TIME_FMT=${CONTAINER_PROCESS_HELPER_TIME_FMT:-"%H:%M:%S"} CONTAINER_PROCESS_RUNAWAY_PROTECTOR=${CONTAINER_PROCESS_RUNAWAY_PROTECTOR:-"TRUE"} CONTAINER_PROCESS_RUNAWAY_LIMIT=${CONTAINER_PROCESS_RUNAWAY_LIMIT:-"50"} +CONTAINER_PROCESS_RUNAWAY_SHOW_OUTPUT_FINAL=${CONTAINER_PROCESS_RUNAWAY_SHOW_OUTPUT_FINAL:-"TRUE"} CONTAINER_SCHEDULING_BACKEND=${CONTAINER_SCHEDULING_BACKEND:-"cron"} CONTAINER_SCHEDULING_LOCATION=${CONTAINER_SCHEDULING_LOCATION:-"/assets/cron/"} CONTAINER_SKIP_SANITY_CHECK=${CONTAINER_SKIP_SANITY_CHECK:-"FALSE"} diff --git a/install/assets/functions/00-container b/install/assets/functions/00-container index 39195ec..0719f75 100755 --- a/install/assets/functions/00-container +++ b/install/assets/functions/00-container @@ -120,7 +120,7 @@ create_zabbix() { print_debug "Adding Zabbix Auto Register configuration for '$1'" if var_true "${CONTAINER_ENABLE_MONITORING}" && [ "${CONTAINER_MONITORING_BACKEND,,}" = "zabbix" ]; then source /assets/defaults/03-monitoring - cat < "${ZABBIX_CONFIG_PATH}"/"${ZABBIX_CONFIG_FILE}.d"/tiredofit_$1.conf + cat < "${ZABBIX_CONFIG_PATH}"/"${ZABBIX_CONFIG_FILE}.d"/tiredofit_"$1".conf # Zabbix $1 Configuration - Automatically Generated # Autoregister=$autoregister EOF @@ -158,7 +158,7 @@ custom_scripts() { fi if [ -d "${ccustom_scripts_source}" ] && dir_notempty ; then - for ccustom_script in ${ccustom_scripts_source}/*.sh ; do + for ccustom_script in "${ccustom_scripts_source}"/*.sh ; do if [ -x "$ccustom_script" ] && [ ! -d "$ccustom_script" ] ; then print_debug "Custom Script executing: '${ccustom_script}'" exec ${ccustom_script} @@ -301,11 +301,11 @@ db_ready() { } dir_empty() { - [ ! -n "$(ls -A $1 2>/dev/null)" ] + [ ! -n "$(ls -A "$1" 2>/dev/null)" ] } dir_notempty() { - [ -n "$(ls -A $1 2>/dev/null)" ] + [ -n "$(ls -A "$1" 2>/dev/null)" ] } file_env() { @@ -728,6 +728,9 @@ print_start() { fi if [ "${CONTAINER_PROCESS_RUNAWAY_PROTECTOR,,}" = "true" ] ; then + if "${CONTAINER_PROCESS_RUNAWAY_SHOW_OUTPUT_FINAL,,}" = "true" ] ; then + if [ "${proc_start_count}" -eq "${CONTAINER_PROCESS_RUNAWAY_LIMIT}" ] ; then SHOW_OUTPUT=TRUE ; fi + fi if [ "${proc_start_count}" -gt "${CONTAINER_PROCESS_RUNAWAY_LIMIT}" ] ; then print_error "POTENTIAL RUNWAY DETECTECTED: Disabling $(basename $PWD) service because it has tried restarting '${CONTAINER_PROCESS_RUNAWAY_LIMIT}' times" s6-svc -d /var/run/s6/legacy-services/$(basename "$PWD") @@ -989,8 +992,8 @@ showoff() { fi fi echo "H4sIAAAAAAAAA61RQRLEIAi78wpvXAq971t68CE8vgni2s7urWUGEyRBHVt7JTYzc+Ga4WD+T+Q/pm9jmQNbIZpNN9OOpGSqnA6I4jJlp1RZZ2OZUbrK3B9nxWw5VB9NiOFNCt5ta8s0kSD3suiBxOQDRh0WxSWQcbuYj9Mp4KuksKAoOVm3qlvRfq1Vl4Nj5fkvZnCsnEeFItgXAgAA" | base64 -d | gunzip - echo ${is} - echo ${ir} + echo "${is}" + echo "${ir}" echo "H4sIAAAAAAAAA1NQgAOfzOxUhdxKhfL8omx7hbDM4swShYySkoJiK3398vJyvZLMotSU/LTMEr3kRP3igvy84vwiLgD/c17OQAAAAA==" | base64 -d | gunzip echo "" }