rngd.service 启动失败的处理

时间:2023-03-09 14:47:22
rngd.service 启动失败的处理
[root@localhost ~]# systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● mdmonitor.service loaded failed failed Software RAID monitoring and management
● postfix.service loaded failed failed Postfix Mail Transport Agent
● rngd.service loaded failed failed Hardware RNG Entropy Gatherer Daemon LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type. loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
[root@localhost ~]# ^C
[root@localhost ~]# systemctl status rngd
● rngd.service - Hardware RNG Entropy Gatherer Daemon
Loaded: loaded (/usr/lib/systemd/system/rngd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since 四 -- :: CST; 41min ago
Main PID: (code=exited, status=/FAILURE) 11月 :: localhost.localdomain systemd[]: Started Hardware RNG Entropy Gatherer Daemon.
11月 :: localhost.localdomain systemd[]: Starting Hardware RNG Entropy Gatherer Daemon...
11月 :: localhost.localdomain rngd[]: Unable to open file: /dev/tpm0
11月 :: localhost.localdomain rngd[]: can't open any entropy source
11月 :: localhost.localdomain rngd[]: Maybe RNG device modules are not loaded
11月 :: localhost.localdomain systemd[]: rngd.service: main process exited, code=exited, status=/FAILURE
11月 :: localhost.localdomain systemd[]: Unit rngd.service entered failed state.
11月 :: localhost.localdomain systemd[]: rngd.service failed.

【解决:修改此服务的启动状态】

cp /usr/lib/systemd/system/rngd.service /etc/systemd/system

vim /etc/systemd/system/rngd.service

[Unit]
Description=Hardware RNG Entropy Gatherer Daemon [Service]
ExecStart=/sbin/rngd -f [Install]
WantedBy=multi-user.target

 systemctl daemon-reload

 systemctl restart rngd

--------------------------------------------------------

【参考:】

[彻底找到 Tomcat 启动速度慢的元凶] http://www.tuicool.com/articles/uaiURzF

在这篇文章中,指出rndg服务是生成随机数的熵服务,配置不当可能阻塞i进程造成tomcat慢等问题;