43355b
From d14d724620fe4810930d1c2f07d10fa6b8bc9557 Mon Sep 17 00:00:00 2001
218d2d
From: Pavel Valena <pvalena@redhat.com>
218d2d
Date: Sun, 23 Jul 2023 19:44:17 +0200
43355b
Subject: [PATCH 2/6] fix(rngd): install system service file
218d2d
218d2d
as there's no reason to keep a copy; there shouldn't be any modifications.
218d2d
218d2d
In case there are args stored in a separate file (Fedora and alike),
218d2d
it needs to be supplied too, but without the option to change the user.
218d2d
---
218d2d
 modules.d/06rngd/module-setup.sh | 7 ++++++-
218d2d
 modules.d/06rngd/rngd.service    | 8 --------
218d2d
 modules.d/06rngd/sysconfig       | 1 +
218d2d
 3 files changed, 7 insertions(+), 9 deletions(-)
218d2d
 delete mode 100644 modules.d/06rngd/rngd.service
218d2d
 create mode 100644 modules.d/06rngd/sysconfig
218d2d
218d2d
diff --git a/modules.d/06rngd/module-setup.sh b/modules.d/06rngd/module-setup.sh
218d2d
index aec8d576..e8bdf7f5 100755
218d2d
--- a/modules.d/06rngd/module-setup.sh
218d2d
+++ b/modules.d/06rngd/module-setup.sh
218d2d
@@ -32,7 +32,12 @@ depends() {
218d2d
 
218d2d
 install() {
218d2d
     inst rngd
218d2d
-    inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service"
218d2d
+    inst_simple "${systemdsystemunitdir}/rngd.service"
218d2d
+
218d2d
+    if [ -r /etc/sysconfig/rngd ]; then
218d2d
+        inst_simple "${moddir}/sysconfig" "/etc/sysconfig/rngd"
218d2d
+    fi
218d2d
+
218d2d
     # make sure dependent libs are installed too
218d2d
     inst_libdir_file opensc-pkcs11.so
218d2d
 
218d2d
diff --git a/modules.d/06rngd/rngd.service b/modules.d/06rngd/rngd.service
218d2d
deleted file mode 100644
218d2d
index dd5374d7..00000000
218d2d
--- a/modules.d/06rngd/rngd.service
218d2d
+++ /dev/null
218d2d
@@ -1,8 +0,0 @@
218d2d
-[Unit]
218d2d
-Description=Hardware RNG Entropy Gatherer Daemon
218d2d
-DefaultDependencies=no
218d2d
-Before=systemd-udevd.service
218d2d
-ConditionVirtualization=!container
218d2d
-
218d2d
-[Service]
218d2d
-ExecStart=/usr/sbin/rngd -f
218d2d
diff --git a/modules.d/06rngd/sysconfig b/modules.d/06rngd/sysconfig
218d2d
new file mode 100644
218d2d
index 00000000..68047ec1
218d2d
--- /dev/null
218d2d
+++ b/modules.d/06rngd/sysconfig
218d2d
@@ -0,0 +1 @@
218d2d
+RNGD_ARGS="-x pkcs11 -x nist"
218d2d
-- 
218d2d
2.42.0
218d2d