From 381a71aca1648a76f590f67e7aeb08e663c5cbcd Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 26 Apr 2022 18:21:42 +0200 Subject: [PATCH] dump-server-state: upstream release 22.04.3 --- CHANGELOG.md | 2 +- evolinux-base/files/dump-server-state.sh | 25 ++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dd72cf3..4735e3cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ The **patch** part changes is incremented if multiple releases happen the same m * evocheck: upstream release 22.04.1 * evolinux-base: Add non-free repos & install non-free firmware on dedicated hardware * evolinux-base: rename backup-server-state to dump-server-state -* dump-server-state: upstream release 22.04.2 +* dump-server-state: upstream release 22.04.3 * generate-ldif: Add services check for bkctld * minifirewall: restore "force-restart" and fix "restart-if-needed" * minifirewall: tail template follows symlinks diff --git a/evolinux-base/files/dump-server-state.sh b/evolinux-base/files/dump-server-state.sh index 5bb3cd4e..5f76413f 100644 --- a/evolinux-base/files/dump-server-state.sh +++ b/evolinux-base/files/dump-server-state.sh @@ -3,7 +3,7 @@ PROGNAME="dump-server-state" REPOSITORY="https://gitea.evolix.org/evolix/dump-server-state" -VERSION="22.04.2" +VERSION="22.04.3" readonly VERSION dump_dir= @@ -76,7 +76,8 @@ END } debug() { if [ "${VERBOSE}" = "1" ]; then - echo "$1" + msg="${1:-$(cat /dev/stdin)}" + echo "${msg}" fi } @@ -717,16 +718,20 @@ task_mysql_processes() { if [ -n "${mysqladmin_bin}" ]; then # Look for local MySQL or MariaDB process if pgrep mysqld > /dev/null || pgrep mariadbd > /dev/null; then - last_result=$(${mysqladmin_bin} --verbose processlist > "${dump_dir}/mysql-processlist.txt") - last_rc=$? + if ${mysqladmin_bin} ping > /dev/null 2>&1; then + ${mysqladmin_bin} --verbose processlist > "${dump_dir}/mysql-processlist.txt" 2> "${dump_dir}/mysql-processlist.err" + last_rc=$? - if [ ${last_rc} -eq 0 ]; then - debug "* mysqladmin OK" + if [ ${last_rc} -eq 0 ]; then + debug "* mysqladmin OK" + else + debug "* mysqladmin ERROR" + debug < "${dump_dir}/mysql-processlist.err" + rm "${dump_dir}/mysql-processlist.err" + rc=10 + fi else - debug "* mysqladmin ERROR" - debug "${last_result}" - # Ignore errors because we don't know how to deal with multiple instances - # rc=10 + debug "* unable to ping with mysqladmin" fi else debug "* no mysqld or mariadbd process is running"