確認環境: CentOS7
最初
# needs-restarting > 空
nss をアップデート
# yum update nss
nss アップデート後に要リスタートなプロセス例
# needs-restarting 2727 : qmgr -l -t unix -u 693 : /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-eth2.pid -lf /var/lib/NetworkManager/dhclient-3a73717e-65ab-93e8-b518-24f5af32dc0d-eth2.lease -cf /var/lib/NetworkManager/dhclient-eth2.conf eth2 2725 : /usr/libexec/postfix/master -w 2217 : sshd: vagrant [priv] 2726 : pickup -l -t unix -u 1074 : /usr/sbin/sshd -D -u0 609 : /usr/sbin/NetworkManager --no-daemon 2220 : sshd: vagrant@pts/0 689 : /usr/lib/polkit-1/polkitd --no-debug 2246 : sudo su - 686 : /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-eth0.pid -lf /var/lib/NetworkManager/dhclient-5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03-eth0.lease -cf /var/lib/NetworkManager/dhclient-eth0.conf eth0
nss アップデート後に要リスタートなサービス例
# needs-restarting -s NetworkManager.service polkit.service postfix.service sshd.service
nss アップデートだと、サーバー再起動までは不要な模様
# needs-restarting -r No core libraries or services have been updated. Reboot is probably not necessary.
カーネルアップデート
# yum update kernel
流石にカーネルアップデート後はサーバー再起動が必要 (当然)
# needs-restarting -r Core libraries or services have been updated: linux-firmware -> 20160830-49.git7534e19.el7 kernel -> 3.10.0-514.26.2.el7 Reboot is required to ensure that your system benefits from these updates. More information: https://access.redhat.com/solutions/27943
reboot後
# needs-restarting > 空
ちなみに、needs-restarting
コマンドは yum-utils
に含まれます。
# yum provides "*needs-restarting*" yum-utils-1.1.31-40.el7.noarch : Utilities based around the yum package manager Repo : base Matched from: Filename : /usr/share/man/man1/needs-restarting.1.gz Filename : /usr/bin/needs-restarting