问题原文
原帖链接 · Johnny Utahh · CC BY-SA 4.0
How can we (more) easily determine if a kernel-change-reboot is required in Debian, other than doing this in a script (which is a bit cumbersome)?
Ubuntu has /var/run/reboot-required and per our experience it works well. However, thus far Debian (at least in Buster, 10.6) does not. Some package(s) might have done this in the past (prior to Debian Jessie) and were replaced thigns that try/claim to do it today, but we've seen nothing work (in 10.6). Details below.
Things we've tried (in Debian 10.6) with no success:
- checkrestart (no simple binary state report for kernel boot)
- needrestart (same problem as #1)
- Despite https://serverfault.com/a/667082/104173 claiming so,
/var/run/reboot-required.pkgshas not yet been visible on our Debian 10.6 system (after a kernel upgrade). - reboot-notifier does not seem to offer anything that works.
lsof | grep lib | grep DELdoes not (yet) seem to provide what we need.
"Nagios output mode" for some of the above options do not (yet) seem easily parsable.
已采纳解答
原帖链接 · gxx · CC BY-SA 4.0
What about checking the return code? needrestart -k -p > /dev/null; echo $? gives 0 for an up-to-date kernel, and 2 if the running kernel is not the expected one.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
