when to reboot?

pixel

Renowned Member
Aug 6, 2014
138
3
83
on ubuntu, i just look for /var/run/reboot-required.

just did an update on proxmox machines, and saw that the kernel was updated. but theres no /var/run/reboot-required. is there another file to look for?
 
AFAIK debian does not have this mechanism.

A reboot is required simply after a kernel upgrade
 
needed an automated check. using this for now.

Code:
[ `ls -tr /boot/initrd* | tail -1 | cut -d '-' -f 2-` != `uname -r` ]

for ansible users:

Code:
- hosts: proxmox
  tasks:
  - name: check for reboot
    shell:  "[ `ls -tr /boot/initrd* | tail -1 | cut -d '-' -f 2-` != `uname -r` ]"
    register: result
    ignore_errors: true
  - debug: msg="{{ inventory_hostname }} needs reboot"
    when: result|success
 
  • Like
Reactions: adrian_vg
Have you automatic updates enabled or why don't you "see" that there is reboot required? A new kernel always implies that you should reboot.