yum update後にサービスの再起動が必要か検証してみました。
以下の記事を参考にしました
https://qiita.com/usiusi360/items/7b47be9d0ab5b1acd608
前提条件
Virtualbox CentOS7です。
補足情報
Virtualboxの場合はパッケージをインストールする場合は、パッケージインストールする際にミラーサイトのhostの名前解決で失敗したため、「ブリッジアダプター」とプロミスキャスモードは「すべて許可」を選択しました。

リポジトリ一覧を表示
現在CentOS7で使用しているリポジトリ一覧となります。
root@localhost ~]# yum repolist
読み込んだプラグイン:fastestmirror
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
Loading mirror speeds from cached hostfile
* epel: d2lzkl7pfhq30w.cloudfront.net
リポジトリー ID リポジトリー名 状態
base/x86_64 CentOS-7.9.2009 - Base 10,072
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,791
extras/x86_64 CentOS-7.9.2009 - Extras 526
updates/x86_64 CentOS-7.9.2009 - Updates 6,173
repolist: 30,562
yum updateを実行
# yum update
「yum update」を実行し、CentOS 7.9.2009 の主要コンポーネントを更新しました。
kernel、NetworkManager、curl、openssl、glibc など約100パッケージが更新され、
システムが最新状態になりました。
サービスの再起動が必要かどうかを確認した
「needs-restarting -s」コマンドを実行することで、再起動が必要なサービスが出力される。
[root@localhost ~]# needs-restarting -s | sort
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
NetworkManager.service
auditd.service
chronyd.service
dbus.service
postfix.service
systemd-journald.service
systemd-logind.service
systemd-udevd.service
tomcat9.service
[root@localhost ~]#
[root@localhost ~]#
OSの再起動が必要か確認した
「システムがこれらの更新の恩恵を受けるためには、再起動が必要です。」とのことです。
そのため、OSの再起動が必要です。
[root@localhost ~]# needs-restarting -r
Core libraries or services have been updated:
glibc -> 2.17-326.el7_9.3
systemd -> 219-78.el7_9.9
linux-firmware -> 20200421-83.git78c0348.el7_9
openssl-libs -> 1:1.0.2k-26.el7_9
kernel -> 3.10.0-1160.119.1.el7
Reboot is required to ensure that your system benefits from these updates.
More information:
https://access.redhat.com/solutions/27943
[root@localhost ~]
OSを再起動した
# reboot
OSの再起動が必要かどうか再度確認した
「Reboot is probably not necessary.」再起動は必要ないそうです。
[root@localhost ~]# needs-restarting -r
No core libraries or services have been updated.
Reboot is probably not necessary.
[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
[root@localhost ~]#
まとめ
設定ファイルを変更する場合は、設定ファイルの文法チェック後にサービスをリロード又はサービスの再起動をします。
今回の検証でyum updateのパッケージアップデートの後は、サービスの再起動とパッケージによってはOSの再起動が必要になる場合があることを知りました。
仮にパッケージのアップデート後にサービスを再起動しない場合は、OSがアップデート前のプログラムをロードして動いた状態になる可能性があるそうで、アップデートが反映されないこともあります。
yum updateの後にサーバーのOSの再起動する場合は、サービス再起動が必要かどうか確認するコマンド「needs-restarting -s」でサービス名が出力されなかったため、サービスの再起動が必要ないと判断しました。
恐らく、OSを再起動したらサービスも停止と起動されるからです。