summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor/systemd-policy
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-31 13:25:51 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-09-06 14:44:12 +0300
commitff075f6ee795a590b244d70a90cc312ba1f2d83d (patch)
treea617790bdbfdeef960665ba0242e1f0c93e5301a /meta-phosphor/recipes-phosphor/systemd-policy
parent3e4da38c127bb7e7641adc2fc41f4c33744cb918 (diff)
downloadopenbmc-ff075f6ee795a590b244d70a90cc312ba1f2d83d.tar.xz
meta-phosphor: Move layer content from common/
Adopt a more conventional directory hierarchy. meta-phosphor is still a _long_ way from suitable for hosting on yoctoproject.org but things like this don't help. (From meta-phosphor rev: 471cfcefa74b8c7ceb704cb670e6d915cf27c63b) Change-Id: I3f106b2f6cdc6cec734be28a6090800546f362eb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/recipes-phosphor/systemd-policy')
-rw-r--r--meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb20
-rw-r--r--meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf13
-rw-r--r--meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/service-restart-policy.conf31
3 files changed, 64 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb
new file mode 100644
index 000000000..ce58a532a
--- /dev/null
+++ b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Phosphor systemd configuration overrides"
+DESCRIPTION = "Overrides for systemd and its applications"
+PR = "r1"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+
+DEPENDS += "systemd"
+
+SRC_URI = "file://service-restart-policy.conf"
+SRC_URI += "file://disable-duplicate-kernel-msg.conf"
+
+FILES_${PN} += "${systemd_unitdir}/system.conf.d/service-restart-policy.conf"
+FILES_${PN} += "${systemd_unitdir}/journald.conf.d/disable-duplicate-kernel-msg.conf"
+
+
+do_install() {
+ install -m 644 -D ${WORKDIR}/service-restart-policy.conf ${D}${systemd_unitdir}/system.conf.d/service-restart-policy.conf
+ install -m 644 -D ${WORKDIR}/disable-duplicate-kernel-msg.conf ${D}${systemd_unitdir}/journald.conf.d/disable-duplicate-kernel-msg.conf
+}
diff --git a/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf
new file mode 100644
index 000000000..beb2f445f
--- /dev/null
+++ b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf
@@ -0,0 +1,13 @@
+# This file overrides some defaults for systemd
+#
+# OpenBMC uses busybox which uses klogd which causes duplicate
+# kernel messages to show up in the journal due to syslog.
+# This override prevents journald from reading from kmsg so
+# only one instance of the kernel messages will show up in
+# journald instead of the two of each currently put in the
+# journal
+#
+# See systemd-system.conf(5) for details on the conf files
+
+[Journal]
+ReadKMsg=no
diff --git a/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/service-restart-policy.conf b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/service-restart-policy.conf
new file mode 100644
index 000000000..54516c2d4
--- /dev/null
+++ b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/service-restart-policy.conf
@@ -0,0 +1,31 @@
+# This file overrides some defaults for systemd
+#
+# - Change the RestartSec from 100ms to 1s.
+# When a service hits a failure, our new debug collection service kicks
+# in. When a core file is involved, it's been found that generating 5 core
+# files within ~500ms puts a huge strain on the BMC. Also, if the bmc is
+# going to get a fix on a restart of a service, the more time the better
+# (think retries on device driver scenarios).
+#
+# - Change the StartLimitBurst to 2
+# Five just seems excessive for our services in openbmc. In all fail
+# scenarios seen so far (other then with phosphor-hwmon), either
+# restarting once does the job or restarting all 5 times does not help
+# and we just end up hitting the 5 limit anyway.
+#
+# - Change the StartLimitIntervalSec to 30s
+# The BMC CPU performance is already challenged. When a service is
+# failing and a core dump is being generated and collected into a dump,
+# it's even more challenged. Recent failures have shown situations where
+# the service does not fail again until 15-20 seconds after the initial
+# failure which means the default of 10s for this results in the service
+# being restarted indefinitely. Change this to 30s to only allow a service
+# to be restarted StartLimitBurst times within a 30s interval before
+# being put in a permanent fail state.
+#
+# See systemd-system.conf(5) for details on the conf files
+
+[Manager]
+DefaultRestartSec=1s
+DefaultStartLimitBurst=2
+DefaultStartLimitIntervalSec=30s