summaryrefslogtreecommitdiffstats
path: root/meta-openbmc-machines
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2017-10-10 14:08:17 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-10-30 21:45:27 +0000
commit8d36279de013793cd3cf01af72f3044192112486 (patch)
tree42195ab57dbac3ba941196c07d07f47aac4eb3b9 /meta-openbmc-machines
parent74cb437b8c4c4a5c7ebdc68d09de377bece59e5e (diff)
downloadtalos-openbmc-8d36279de013793cd3cf01af72f3044192112486.tar.gz
talos-openbmc-8d36279de013793cd3cf01af72f3044192112486.zip
Write journal to persistent storage
Currently the journal is written to a RAM based filesystem which is lost on BMC reboots. This commit will move the journal to a persistent filesystem location so it will be available after BMC reboots for debug. This change is only being done by default on witherspoon systems with this commit. Other systems may use this as a reference if they wish to move. By default, journald uses 10% of the filesystem (default is /var/log/journal/) and it will ensure 15% of the filesystem space is left free. Specific machine configs in openbmc can override these defaults if they wish. For witherspoon, we will use 3MB max and use the 15% left free default. Due to the way openbmc mounts its filesytems, a systemd-journald.service file override is required to ensure journald does not start until the /etc/ filesystem is fully mounted. journald uses /etc/machine-id to create a directory in which it stores its journal data. journalctl uses /etc/machine-id to know which directory to look into when a user requests the data. Without this override, journald will end up making a random machine-id and using that because /etc/machine-id is not available when systemd-journald.service is started. journalctl looks up the /etc/machine-id when its run, so it will use the correct one (but not the one journald is using). Witherspoon uses the new UBI filesystem, and only has a total of 4MB available within /var. Ensure the journal only ever uses 3MB of that space to leave room for other applications. In testing it was found that the persistence of journald had minor impacts to overall flash erase blocks. With persistence enabled or disabled, it was noted that the UBI maximum erase count value incremented by 1 for every 10-20 boots of the host. Our CI system, which gets a lot of activity (new image flashing, REST api testing, and host boots) average 10-12 erase counts a day. A worst case of 15 erase blocks a day would mean 18.2 years before hitting the 100,000 erase block limit. Resolves openbmc/openbmc#1627 Change-Id: I30211108f26bd9cd758800f457c17ed03d13e802 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
Diffstat (limited to 'meta-openbmc-machines')
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/journald-size-policy.conf8
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/journald-storage-policy.conf8
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/systemd-journald-override.conf3
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd_%.bbappend14
4 files changed, 33 insertions, 0 deletions
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/journald-size-policy.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/journald-size-policy.conf
new file mode 100644
index 000000000..b8285f4b0
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/journald-size-policy.conf
@@ -0,0 +1,8 @@
+# This file overrides a default for journald
+#
+# - Set a maximum size of 3MB for journald in filesystem
+#
+# See journald.conf(5) for details
+
+[Journal]
+SystemMaxUse=3M
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/journald-storage-policy.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/journald-storage-policy.conf
new file mode 100644
index 000000000..eb746a56f
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/journald-storage-policy.conf
@@ -0,0 +1,8 @@
+# This file overrides a default for journald
+#
+# - Default journald to write to persistent storage
+#
+# See journald.conf(5) for details
+
+[Journal]
+Storage=persistent
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/systemd-journald-override.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/systemd-journald-override.conf
new file mode 100644
index 000000000..0ca86f863
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd/systemd-journald-override.conf
@@ -0,0 +1,3 @@
+[Unit]
+Wants=local-fs.target
+After=local-fs.target
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd_%.bbappend b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd_%.bbappend
new file mode 100644
index 000000000..b4bfc1f12
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/systemd/systemd_%.bbappend
@@ -0,0 +1,14 @@
+FILESEXTRAPATHS_append := "${THISDIR}/${PN}:"
+SRC_URI += "file://journald-storage-policy.conf"
+SRC_URI += "file://systemd-journald-override.conf"
+SRC_URI += "file://journald-size-policy.conf"
+
+FILES_${PN} += "${libdir}/systemd/journald.conf.d/journald-storage-policy.conf"
+FILES_${PN} += "${systemd_system_unitdir}/systemd-journald.service.d/systemd-journald-override.conf"
+FILES_${PN} += "${libdir}/systemd/journald.conf.d/journald-size-policy.conf"
+
+do_install_append() {
+ install -m 644 -D ${WORKDIR}/journald-storage-policy.conf ${D}${libdir}/systemd/journald.conf.d/journald-storage-policy.conf
+ install -m 644 -D ${WORKDIR}/systemd-journald-override.conf ${D}${systemd_system_unitdir}/systemd-journald.service.d/systemd-journald-override.conf
+ install -m 644 -D ${WORKDIR}/journald-size-policy.conf ${D}${libdir}/systemd/journald.conf.d/journald-size-policy.conf
+}
OpenPOWER on IntegriCloud