From 679e15c484df53dd2fac99e34363628db4d2b32a Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:29 -0400 Subject: [PATCH] Add *.update-* obsolete configs to dpkg plugin --- roles/base/files/usr/lib/check_mk_agent/plugins/dpkg | 2 +- roles/base/templates/usr/local/sbin/dpkg-cleanup.sh.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/base/files/usr/lib/check_mk_agent/plugins/dpkg b/roles/base/files/usr/lib/check_mk_agent/plugins/dpkg index caba2b2..6c619dd 100755 --- a/roles/base/files/usr/lib/check_mk_agent/plugins/dpkg +++ b/roles/base/files/usr/lib/check_mk_agent/plugins/dpkg @@ -23,7 +23,7 @@ DEBIAN_VERSION="$( cat /etc/debian_version )" TOTAL_PACKAGES=$( head --lines=1 <<<"${TMP_AWK}" ) UPGRADABLE_PACKAGES=( $( apt list --upgradable 2>/dev/null | grep -v '^Listing' | awk '{ gsub(/\]/,"",$NF); print $1 "[" $NF "<>" $2 "]" }' ) ) INCONSISTENT_PACKAGES=( $( tail --lines=+2 <<<"${TMP_AWK}" ) ) -OLD_CONFIG_FILES=( $( ionice -c3 find /etc -type f -a \( -name '*.dpkg-*' -o -name '*.ucf-*' \) 2>/dev/null ) ) +OLD_CONFIG_FILES=( $( ionice -c3 find /etc -type f -a \( -name '*.dpkg-*' -o -name '*.ucf-*' -o -name '*.update-*' \) 2>/dev/null ) ) echo "<<>>" echo "debian_version ${DEBIAN_VERSION}" diff --git a/roles/base/templates/usr/local/sbin/dpkg-cleanup.sh.j2 b/roles/base/templates/usr/local/sbin/dpkg-cleanup.sh.j2 index e5af7d2..8bd7de0 100755 --- a/roles/base/templates/usr/local/sbin/dpkg-cleanup.sh.j2 +++ b/roles/base/templates/usr/local/sbin/dpkg-cleanup.sh.j2 @@ -16,5 +16,5 @@ apt autoremove --purge -y apt clean # Phase 4 - find and remove obsolete config files -OLD_FILES_LIST=( $( find /etc -type f -a \( -name '*.dpkg-*' -o -name '*.ucf-*' \) 2>/dev/null ) ) +OLD_FILES_LIST=( $( find /etc -type f -a \( -name '*.dpkg-*' -o -name '*.ucf-*' -o -name '*.update-*' \) 2>/dev/null ) ) rm -f ${OLD_FILES_LIST[@]}