Merge "set a maximum systemd journal size"

This commit is contained in:
Zuul
2025-08-05 18:16:45 +00:00
committed by Gerrit Code Review
2 changed files with 18 additions and 0 deletions

View File

@@ -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:

View File

@@ -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