当我使用apt来更新我的系统时(例如运行sudo aptitude full-upgrade),它有时会安装需要重新启动的更新.这适用于esp.用于内核(安全)更新.
我有时可以在ssh登录消息中看到这个.我想知道如何(否则)我可以确定系统是否需要重新启动由于这些更新.
MOTD“需要重启”文本由/usr/lib / update-notifier / update-motd-reboot-
required生成,它检查/ var / run / reboot-
required是否存在并从中拉出文本:
#!/bin/sh -e
#
# helper for update-motd
if [ -f /var/run/reboot-required ]; then
cat /var/run/reboot-required
fi