Feature request: Reboot required

Apr 26, 2018
111
10
23
Certain Proxmox packages do not notify administrators of a required reboot. For example, the kernel, glibc, libc6, systemd. Likely there are other packages but those come to mind.

With Debian and Ubuntu, such packages create /var/run/reboot-required.pkgs or /var/run/reboot-required. Those files provide administrators a way of evaluating reboots.

As /run typically is mounted in tmpfs, the files disappear on a reboot.

This is a handy feature. I hope you will consider. I can help test.

Thanks much. :)
 
Certain Proxmox packages do not notify administrators of a required reboot. For example, the kernel, glibc, libc6, systemd. Likely there are other packages but those come to mind.

With Debian and Ubuntu, such packages create /var/run/reboot-required.pkgs or /var/run/reboot-required. Those files provide administrators a way of evaluating reboots.

As /run typically is mounted in tmpfs, the files disappear on a reboot.

This is a handy feature. I hope you will consider. I can help test.

Thanks much. :)

except for the kernel, none of those are provided by Proxmox. there are already lots of tools that handle stuff like this (I would recommend needrestart, but you probably want to add lxc-monitord and pve-container@* to the whitelist of services which should not be restarted).
 
Thank you for the reply.

If the kernel packages are updated to provide the standard Debian/Ubuntu /var/run/reboot-required.pkgs or /var/run/reboot-required, then that would be nice too.

I use the needs-restarting and needs-restart tools in CentOS. I was unaware of a similar tool in Debian. Thank you for that information. :)
 
Hi there,
any news on that - shouldnt be a big deal to provide those files with your custom rolled kernel.
We could really use these information for our ansible scripts to automagically reboot the systems, as we try to manage all our PVE nodes with ansible.
 
Now 3 years have passed, but nothing seems to have happened. We also use a monitoring tool for our various customers, which checks for necessary reboots and cannot currently detect the necessary reboot after a PVE kernel update.

Is there still a change, as something is happening here? Otherwise I would look for a workaround...
 
For years, we check if the next boot kernel is the same as we have booted right know and if they differ, there is a new kernel present and should be booted. This way, we always get notified and this is independend of any reboot-required files.

Code:
grep vmlinuz /boot/grub/grub.cfg  | head -1 | awk '{ print $2 }' | sed -e 's%/boot/vmlinuz-%%;s%/ROOT/pve-1@%%'

check that against

Code:
uname -r
 
I was also looking at this and I think a clean way I found of doing it is using ansible.builtin.apt in check_mode first:

YAML:
    - name: Running apt in check mode to see what will be updated
      ansible.builtin.apt:
        update_cache: true
        upgrade: dist
      check_mode: true
      register: rc_apt

    - name: Flag a kernel upgrade
      ansible.builtin.set_fact:
        pve_kernel_upgrade: true
      when: '"Inst proxmox-kernel" in rc_apt.stdout'

Then farther down your play, just check for pve_kernel_upgrade to decide whether you need to reboot.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!