rng-tools: Lower niceness of rngd
This gives more CPU time to the daemons and requests are are more
important to run in a timely matter. We can see that we reach ipmid
coming up and multi-user ~20s faster on an ast2500.
Before priority reduction:
root@zaius:~# journalctl -u phosphor-ipmi-host -o short-monotonic
-- Logs begin at Thu 2019-05-16 07:27:57 UTC, end at Thu 2019-05-16 07:31:25 UTC. --
[ 86.855857] zaius systemd[1]: Starting Phosphor Inband IPMI...
[ 91.624926] zaius ipmid[1423]: JSON file not found
[ 93.436815] zaius systemd[1]: Started Phosphor Inband IPMI.
[ 94.615676] zaius ipmid[1423]: Loading whitelist filter
[ 94.686476] zaius ipmid[1423]: Set restrictedMode = false
[ 95.791197] zaius ipmid[1423]: New interface mapping
root@zaius:~# journalctl -u multi-user.target -o short-monotonic
-- Logs begin at Thu 2019-05-16 07:27:57 UTC, end at Thu 2019-05-16 07:31:25 UTC. --
After priority reduction:
[ 106.580622] zaius systemd[1]: Reached target Multi-User System.
root@zaius:~# journalctl -u phosphor-ipmi-host -o short-monotonic
-- Logs begin at Thu 2019-05-16 07:38:53 UTC, end at Thu 2019-05-16 07:41:20 UTC. --
[ 70.097045] zaius systemd[1]: Starting Phosphor Inband IPMI...
[ 73.578294] zaius ipmid[1423]: JSON file not found
[ 75.026965] zaius systemd[1]: Started Phosphor Inband IPMI.
[ 76.143958] zaius ipmid[1423]: Loading whitelist filter
[ 76.301370] zaius ipmid[1423]: Set restrictedMode = false
[ 76.945443] zaius ipmid[1423]: Command in process, no attention
[ 77.062437] zaius ipmid[1423]: New interface mapping
root@zaius:~# journalctl -u multi-user.target -o short-monotonic
-- Logs begin at Thu 2019-05-16 07:38:53 UTC, end at Thu 2019-05-16 07:41:20 UTC. --
[ 83.550371] zaius systemd[1]: Reached target Multi-User System.
Change-Id: I9ce06a2fe792dc31d9dddd7c90f48b28aa721892
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/recipes-support/rng-tools/rng-tools/10-nice.conf b/recipes-support/rng-tools/rng-tools/10-nice.conf
new file mode 100644
index 0000000..de71db4
--- /dev/null
+++ b/recipes-support/rng-tools/rng-tools/10-nice.conf
@@ -0,0 +1,6 @@
+[Service]
+# Make the priority of the random number generator seeding
+# process nearly the lowest on the system but allow
+# daemons to have lower priority if desired. This makes our
+# system much more responsive during boot.
+Nice=18
diff --git a/recipes-support/rng-tools/rng-tools_%.bbappend b/recipes-support/rng-tools/rng-tools_%.bbappend
new file mode 100644
index 0000000..16add36
--- /dev/null
+++ b/recipes-support/rng-tools/rng-tools_%.bbappend
@@ -0,0 +1,13 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI += "file://10-nice.conf"
+
+inherit systemd
+
+FILES_${PN} += "${systemd_unitdir}/system/rngd.service.d"
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system/rngd.service.d
+ install -m 644 ${WORKDIR}/10-nice.conf ${D}${systemd_unitdir}/system/rngd.service.d
+ fi
+}