I'm using unattended upgrades and I want to reboot automatically when kernel is upgraded.
Is that possible?
I'm using unattended upgrades and I want to reboot automatically when kernel is upgraded.
Is that possible?
You can set up automatic reboot after Unattended Upgrades has upgraded/installed something that requires reboot. That includes installing new kernels.
Related configuration variables:
// Automatically reboot *WITHOUT CONFIRMATION* if
// the file /var/run/reboot-required is found after the upgrade
//Unattended-Upgrade::Automatic-Reboot "false";
// Automatically reboot even if there are users currently logged in
// when Unattended-Upgrade::Automatic-Reboot is set to true
//Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
// Default: "now"
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";
Save your preferred settings in file /etc/apt/apt.conf.d/52unattended-upgrades-local (so that you do not have to modify 50unattended-upgrades provided by the package).
You can see explicitly set configuration values by
apt-config dump unattended-upgrade
Unfortunately, you can not list all current values.
https://github.com/mvo5/unattended-upgrades/issues/245
You could see more documentation (of the latest version) at https://github.com/mvo5/unattended-upgrades
Unfortunately not all supported options are explained there, though:
https://github.com/mvo5/unattended-upgrades/issues/246
https://github.com/mvo5/unattended-upgrades/issues/318