【Linux专题】如何知道系统是否需要完全重启
发布作者:微思网络 发布时间:2022-09-02 浏览量:0次
一个简单的场景: 执行完 yum update 命令后,是否需要重启服务器?
[root@localhost ~]# yum -y install yum-utils
[root@localhost ~]# needs-restarting
[root@localhost ~]# echo $?
0
[root@localhost ~]# needs-restarting -r
No core libraries or services have been updated.
Reboot is probably not necessary.
[root@localhost ~]#
*注: 0 表示无需重启; 1 表示需要重启
[root@localhost ~]# needs-restarting -r
Core libraries or services have been updated:
openssl-libs -> 1:1.0.2k-25.el7_9
linux-firmware -> 20200421-80.git78c0348.el7_9
Reboot is required to ensure that your system benefits from these updates. # 需要重启以确保你的系统从这些更新中受益
More information:
https://access.redhat.com/solutions/27943
[root@localhost ~]#
[root@localhost ~]# needs-restarting -s
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
rpcbind.service
NetworkManager.service
postfix.service
dbus.service
auditd.service
vmtoolsd.service
bluetooth.service
ksmtuned.service
vgauthd.service
libvirtd.service
systemd-udevd.service
smartd.service
firewalld.service
irqbalance.service
[root@localhost ~]#