如果你遇到 rngd.service 无法启动的问题(这适用于使用 systemd 的系统,如CentOS 7 /8 和 RHEL 7 系统)
1.先备份文件
cp /usr/lib/systemd/system/rngd.service rngd.service.bak
2.编辑 /etc/systemd/system/rngd.service 的新副本,并将“-r /dev/urandom -o /dev/random”选项添加到 ExecStart 值中,如下所示:
[Unit]
Description=Hardware RNG Entropy Gatherer Daemon
ConditionVirtualization=!container
# The "-f" option is required for the systemd service rngd to work with Type=simple
[Service]
Type=simple
EnvironmentFile=/etc/sysconfig/rngd
ExecStart=/usr/sbin/rngd -f -r /dev/urandom -o /dev/random
[Install]
WantedBy=sysinit.target
原配置文件修改对比
3.指示 systemd 重新加载其配置文件,重新启动 rngd 服务并验证它是否正常运行:
systemctl daemon-reload && systemctl stop rngd && systemctl start rngd && systemctl status rngd