Unattended-Upgrade::Automatic-Reboot default value
Solution 1
If you don't want it to auto-reboot, make that section look like this:
// Automatically reboot *WITHOUT CONFIRMATION*
// if the file /var/run/reboot-required is found after the upgrade
Unattended-Upgrade::Automatic-Reboot "false";
I have it set that way and it works.
This page says that not rebooting is the default, but I'm pretty sure that's wrong. I think the first time my system autoinstalled a kernel (before I changed the config), it rebooted. But in either case, the config above will prevent it.
Solution 2
The default for automatically rebooting after unattended-upgrades is FALSE.
You can confirm on your own system by looking where the default value is stored, in the script itself:
grep 'Automatic-Reboot"' /usr/bin/unattended-upgrade
The default could change with a software upgrade, although that seems unlikely. To be certain your systems don't reboot by after automatic upgrades, explicitly disable rebooting in your configuration.
Related videos on Youtube
Stringer
Updated on September 18, 2022Comments
-
Stringer over 1 year
In my
/etc/apt/apt.conf.d/50unattended-upgrades
i found this:// Automatically reboot *WITHOUT CONFIRMATION* // if the file /var/run/reboot-required is found after the upgrade //Unattended-Upgrade::Automatic-Reboot "false";
The issue is that I don't know what the default value is and so if I need to uncomment the line (I don't want my server to reboot btw).
Should I uncomment the line by safety? Are there further actions to perform after doing that?
-
derHugo over 6 yearsYou could test it be putting this file there manually as test
sudo touch /car/run/reboot-required
.. usually default should not be an autoreboot
-
-
Stringer over 6 yearsThanks, I'll take the safe path then. From what I understand only a kernel update needs a reboot and it is disable by default (if you have choosen auto install of security packages). Anyway I'll go the safe path.
-
Reinier Post over 6 yearsI don't think it's wrong, my systems don't reboot automatically unless I told them to.
-
Organic Marble over 6 yearsThat could well be, I was experimenting with a lot of different options.
-
zaTricky over 5 years100% with @ReinierPost - I have many servers in production; one rebooted automatically and the rest did not, which led me to this answer. All servers except the one that rebooted have it commented out thus using the default, which is to not reboot. The one that rebooted had it set to "true", which I have now fixed by commenting it out.
-
SherylHohman over 5 yearsdefault value is to NOT reboot. libre-software.net/ubuntu-automatic-updates and linux-audit.com/using-unattended-upgrades-on-debian-and-ubuntu Also, See serverfault.com/a/606852/399723 if you're using debian-7=wheezy or earlier AKA ubuntu 13.10 or earlier, because you'll need an additional package for this setting to work correctly.
-
Eleni almost 5 yearsI made the same observation and was originally only looking at
/etc/apt/apt.conf.d/50unattended-upgrades://Unattended-Upgrade::Automatic-Reboot "false";
. After 2 hours I realised I had:/etc/apt/apt.conf.d/10periodic:Unattended-Upgrade::Automatic-Reboot "true";