From 0003e6817b18aee66b913f5accafbc9413e61fe2 Mon Sep 17 00:00:00 2001 From: zhangruifang2020 Date: Mon, 24 Apr 2023 11:34:16 +0800 Subject: [PATCH] Fix serveral issues --- rng-tools.spec | 12 ++++++++++-- rngd.service | 5 ++++- rngd.sysconfig | 3 +++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 rngd.sysconfig diff --git a/rng-tools.spec b/rng-tools.spec index 4fc4ba6..7188383 100644 --- a/rng-tools.spec +++ b/rng-tools.spec @@ -1,11 +1,12 @@ Name: rng-tools Version: 6.16 -Release: 2 +Release: 3 Summary: Random number generator daemon License: GPLv2+ URL: https://github.com/nhorman/rng-tools Source0: https://github.com/nhorman/rng-tools/archive/v%{version}.tar.gz Source1: rngd.service +Source2: rngd.sysconfig #Dependency BuildRequires: gcc make gettext systemd autoconf automake @@ -37,6 +38,8 @@ and supplies entropy from them to the system kernel's /dev/random machinery. %make_install install -D -t $RPM_BUILD_ROOT%{_unitdir} -m 0644 %{SOURCE1} +# install sysconfig file +install -D %{SOURCE2} -m0644 %{buildroot}%{_sysconfdir}/sysconfig/rngd %check export RNGD_JITTER_TIMEOUT=10 #Enseur that the AES can be generated. @@ -60,13 +63,18 @@ export RNGD_JITTER_TIMEOUT=10 #Enseur that the AES can be generated. %{_bindir}/rngtest %{_bindir}/randstat %{_sbindir}/rngd -%attr(0644,root,root) %{_unitdir}/rngd.service +%attr(0644,root,root) %{_unitdir}/rngd.service +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/rngd %files help %{_mandir}/man1/rngtest.1.* %{_mandir}/man8/rngd.8.* %changelog +* Mon Apr 24 2023 zhangruifang - 6.16-3 +- Update the rngd.service file +- Add the config file for rngd service + * Fri Apr 21 2023 zhangruifang - 6.16-2 - enable make check diff --git a/rngd.service b/rngd.service index 3d9dcb5..189b34c 100644 --- a/rngd.service +++ b/rngd.service @@ -1,8 +1,11 @@ [Unit] Description=Hardware RNG Entropy Gatherer Daemon +# The "-f" option is required for the systemd service rngd to work with Type=simple [Service] -ExecStart=/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..cf18656 --- /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="-O jitter:timeout:10" -- Gitee