diff --git a/dib/ironic-python-agent-ramdisk/README.rst b/dib/ironic-python-agent-ramdisk/README.rst index d348823..6137abe 100644 --- a/dib/ironic-python-agent-ramdisk/README.rst +++ b/dib/ironic-python-agent-ramdisk/README.rst @@ -25,6 +25,9 @@ Beyond installing the ironic-python-agent, this element does the following: listen for raw data from stdin and write compressed data to stdout. Command can be with arguments. * Configures rescue mode if ``DIB_IPA_ENABLE_RESCUE`` is not set to ``false``. +* By default, sets a maximum size for the ramdisk systemd journal to 15M. This + can be disabled by setting ``DIB_IPA_DISABLE_JOURNAL_MAX_LOG_SIZE`` to any + value which is not ``False``. This element outputs three files: diff --git a/dib/ironic-python-agent-ramdisk/post-install.d/98-set-journal-config b/dib/ironic-python-agent-ramdisk/post-install.d/98-set-journal-config new file mode 100755 index 0000000..727953c --- /dev/null +++ b/dib/ironic-python-agent-ramdisk/post-install.d/98-set-journal-config @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +DIB_IPA_DISABLE_JOURNAL_MAX_LOG_SIZE=${DIB_IPA_DISABLE_JOURNAL_MAX_LOG_SIZE:-False} + +if [[ "$DIB_IPA_DISABLE_JOURNAL_MAX_LOG_SIZE" == "False" ]]; then + # Default templates have a journal section already defined, and we don't use + # iniset by convention, so unless we really need to, we'll just append here. + echo "SystemMaxUse=15M" >> /etc/systemd/journald.conf +fi