From 12e926e87ddd5d11536a92e529e411569d9c7439 Mon Sep 17 00:00:00 2001 From: Vladis Dronov Date: Mon, 20 Sep 2021 14:25:17 +0200 Subject: [PATCH] Add a config file for storing rngd options So rngd options can be adjusted and not overwritten on updates (bz1252175) Disable pkcs11 and nist entropy sources by default (bz1252175#c21) Signed-off-by: Vladis Dronov --- rng-tools.spec | 11 ++++++++--- rngd.service | 5 ++++- rngd.sysconfig | 3 +++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 rngd.sysconfig diff --git a/rng-tools.spec b/rng-tools.spec index 7145be0..20833b8 100644 --- a/rng-tools.spec +++ b/rng-tools.spec @@ -16,6 +16,7 @@ License: GPLv2+ URL: https://github.com/nhorman/rng-tools Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: rngd.service +Source2: rngd.sysconfig BuildRequires: gcc make BuildRequires: gettext @@ -63,6 +64,8 @@ Hardware random number generation tools. # install systemd unit file install -Dt %{buildroot}%{_unitdir} -m0644 %{SOURCE1} +# install sysconfig file +install -D %{SOURCE2} -m0644 %{buildroot}%{_sysconfdir}/sysconfig/rngd %post %systemd_post rngd.service @@ -81,13 +84,15 @@ install -Dt %{buildroot}%{_unitdir} -m0644 %{SOURCE1} %{_sbindir}/rngd %{_mandir}/man1/rngtest.1.* %{_mandir}/man8/rngd.8.* -%attr(0644,root,root) %{_unitdir}/rngd.service +%attr(0644,root,root) %{_unitdir}/rngd.service +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/rngd %changelog -* Sat Sep 18 2021 Vladis Dronov - 6.14-1.git.56626083 +* Mon Sep 20 2021 Vladis Dronov - 6.14-1.git.56626083 - Update to the upstream v6.14 + tip of origin/master @ 56626083 -- Add an important cb52458b and a revert of 2ce93190 +- Add an important 82f665c4 and a revert of 2ce93190 - Add a fix for covscan unused variable warning +- Add a config file for storing rngd options * Tue Sep 14 2021 Sahana Prasad - 6.13-4.git.d207e0b6 - Rebuilt with OpenSSL 3.0.0 diff --git a/rngd.service b/rngd.service index 1cc09da..2bd9e09 100644 --- a/rngd.service +++ b/rngd.service @@ -2,8 +2,11 @@ Description=Hardware RNG Entropy Gatherer Daemon ConditionVirtualization=!container +# The "-f" option is required for the systemd service rngd to work with Type=simple [Service] -ExecStart=/usr/sbin/rngd -f +Type=simple +EnvironmentFile=/etc/sysconfig/rngd +ExecStart=/usr/sbin/rngd -f $RNGD_ARGS [Install] WantedBy=multi-user.target diff --git a/rngd.sysconfig b/rngd.sysconfig new file mode 100644 index 0000000..0937086 --- /dev/null +++ b/rngd.sysconfig @@ -0,0 +1,3 @@ +# Optional arguments passed to rngd. See rngd(8) and +# https://bugzilla.redhat.com/show_bug.cgi?id=1252175#c21 +RNGD_ARGS="-x pkcs11 -x nist"