/var/run/reboot-required
cat /var/run/reboot-required
*** System restart required ***
また、サービスの再起動が必要な場合は、次のコマンドを実行してその判断が可能です。
sudo checkrestart
Found 27 processes using old versions of upgraded files
(14 distinct programs)
(10 distinct packages)
Of these, 9 seem to contain systemd service definitions or init scripts which can be used to restart them.
The following packages seem to have definitions that could be used
to restart their services:
accountsservice:
441 /usr/lib/accountsservice/accounts-daemon
networkd-dispatcher:
470 /usr/bin/networkd-dispatcher
policykit-1:
471 /usr/lib/policykit-1/polkitd
rsyslog:
473 /usr/sbin/rsyslogd
modemmanager:
511 /usr/sbin/ModemManager
unattended-upgrades:
567 /usr/share/unattended-upgrades/unattended-upgrade-shutdown
openssh-server:
683 /usr/sbin/sshd
246134 /usr/sbin/sshd
246245 /usr/sbin/sshd
apache2-bin:
15285 /usr/sbin/apache2
238252 /usr/sbin/apache2
238253 /usr/sbin/apache2
238254 /usr/sbin/apache2
238255 /usr/sbin/apache2
238258 /usr/sbin/apache2
238559 /usr/sbin/apache2
238902 /usr/sbin/apache2
244571 /usr/sbin/apache2
244580 /usr/sbin/apache2
packagekit:
246707 /usr/lib/packagekit/packagekitd
These are the systemd services:
systemctl restart accounts-daemon.service
systemctl restart networkd-dispatcher.service
systemctl restart polkit.service
systemctl restart ModemManager.service
systemctl restart packagekit-offline-update.service
systemctl restart packagekit.service
These are the initd scripts:
service rsyslog restart
service unattended-upgrades restart
service ssh restart
service apache2 restart
These processes (1) do not seem to have an associated init script to restart them:
passenger:
238230 /usr/lib/passenger/support-binaries/PassengerAgent
238235 /usr/lib/passenger/support-binaries/PassengerAgent
上記で再起動の必要性があったのでシステム全体を再起動。
sudo checkrestart
# Found 0 processes using old versions of upgraded filesと表示されること
cat /var/run/reboot-required
# ファイルがないこと