Interview Prep/Linux/Patching, Automation & Golden Images

How do you know whether a server needs a reboot after patching?

BeginnerProductionPatching, Automation & Golden Images
Answer
[ -f /var/run/reboot-required ] && cat /var/run/reboot-required.pkgs   # Debian/Ubuntu
sudo dnf needs-restarting -r      # RHEL: exit code 1 = reboot needed
sudo dnf needs-restarting -s      # services that need a restart
sudo needrestart -r l             # Debian: list services using old libraries

Also compare uname -r with the newest installed kernel.

All Linux questions Roadmap: Linux

More on Patching, Automation & Golden Images