diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 6f0eeb807c..0ad4b2c511 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -444,6 +444,11 @@ if [ "$AMP_ENABLE_FULL_MAC_SECURITY" -ne 1 ]; then fi fi +# Disable the dnf makecache timer +if [ "${AMP_BASEOS}" = "centos-minimal" ] || [ "${AMP_BASEOS}" = "fedora" ] || [ "${AMP_BASEOS}" = "rhel" ]; then + AMP_element_sequence="$AMP_element_sequence disable-makecache" +fi + if [ "${AMP_BASEOS}" = "centos-minimal" ]; then export DIB_YUM_MINIMAL_CREATE_INTERFACES=0 fi diff --git a/elements/disable-makecache/README.rst b/elements/disable-makecache/README.rst new file mode 100644 index 0000000000..d82e6e2638 --- /dev/null +++ b/elements/disable-makecache/README.rst @@ -0,0 +1,6 @@ +This element disables the dnf makecache hourly timer. + +The amphora typically do not have internet access nor access to DNS servers. +We want to disable this makecache timer to stop the amphora from attempting +to update/download the dnf cache every hour. Without this element it will +run and log a failure every hour. diff --git a/elements/disable-makecache/post-install.d/80-disable-makecache b/elements/disable-makecache/post-install.d/80-disable-makecache new file mode 100755 index 0000000000..32aafd439b --- /dev/null +++ b/elements/disable-makecache/post-install.d/80-disable-makecache @@ -0,0 +1,18 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi + +set -eu +set -o pipefail + +case $DISTRO_NAME in + fedora | centos* | rhel* ) + systemctl disable dnf-makecache.timer || true + ;; + *) + echo "ERROR: Unsupported distribution $DISTRO_NAME" + exit 1 + ;; +esac diff --git a/elements/disable-makecache/svc-map b/elements/disable-makecache/svc-map new file mode 100644 index 0000000000..34c2f13082 --- /dev/null +++ b/elements/disable-makecache/svc-map @@ -0,0 +1,2 @@ +disable-makecache: + default: disable-makecache