How can I customize rngd service startup?
Environment
- Red Hat Enterprise Linux (RHEL) 7 and 8
Issue
- The
rngdservice fails at startup on a virtual server as an entropy device is not available.
Resolution
-
With Red Hat Enterprise Linux 7 and 8,
rngddoes not have a configuration file which can be altered. Becausesystemdis used, it is possible to enable changing default settings by overriding those by following these steps:cp /usr/lib/systemd/system/rngd.service /etc/systemd/system- Edit the file - setting the required runtime options or any other options available with systemd
systemctl daemon-reload# make systemd aware of the changessystemctl start rngd.service
-
As an example, in the
/etc/systemd/system/rngd.servicefile modify the execution linefrom: `ExecStart=/sbin/rngd -f ` to: `ExecStart=/sbin/rngd -f -r /dev/urandom -o /dev/random`
Root Cause
- Trusted Platform Module (TPM) is not available for the system
- No option to use environment variables to customize rngd service.
Diagnostic Steps
-
Check the status:
# service rngd status -l Redirecting to /bin/systemctl status rngd.service rngd.service - Hardware RNG Entropy Gatherer Daemon Loaded: loaded (/usr/lib/systemd/system/rngd.service; enabled) Active: failed (Result: exit-code) since Thu 2015-03-12 15:32:29 IST; 11min ago Process: 13105 ExecStart=/sbin/rngd -f (code=exited, status=1/FAILURE) Main PID: 13105 (code=exited, status=1/FAILURE) Mar 12 15:32:29 illin3097 systemd[1]: Started Hardware RNG Entropy Gatherer Daemon. Mar 12 15:32:29 illin3097 rngd[13105]: Unable to open file: /dev/tpm0 Mar 12 15:32:29 illin3097 rngd[13105]: can't open any entropy source Mar 12 15:32:29 illin3097 rngd[13105]: Maybe RNG device modules are not loaded Mar 12 15:32:29 illin3097 systemd[1]: rngd.service: main process exited, code=exited, status=1/FAILURE Mar 12 15:32:29 illin3097 systemd[1]: Unit rngd.service entered failed state.
SBR
Product(s)
Tags
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.