From 6ee60647c92f105e56a86605148517d5332472b5 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 18 May 2020 13:34:11 -0700 Subject: [PATCH] upgrades: Always schedule a reboot at 02:00 local time Test: - Downgrade kernel (linux-image-amd64) to earlier version. - Reboot into the older kernel. - Remove the newer kernel package. - Run FreedomBox in develop mode. - Run unattended-upgrades --debug to upgrade all packages. - At the end a message is printed that shutdown is scheduled. - Check /run/systemd/shutdown/scheduled file and see that microseconds since epoch is set to tomorrow 02:00 local time. Signed-off-by: Sunil Mohan Adapa --- .../upgrades/data/etc/apt/apt.conf.d/60unattended-upgrades | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plinth/modules/upgrades/data/etc/apt/apt.conf.d/60unattended-upgrades b/plinth/modules/upgrades/data/etc/apt/apt.conf.d/60unattended-upgrades index f9965ce21..363873f00 100644 --- a/plinth/modules/upgrades/data/etc/apt/apt.conf.d/60unattended-upgrades +++ b/plinth/modules/upgrades/data/etc/apt/apt.conf.d/60unattended-upgrades @@ -18,3 +18,7 @@ Unattended-Upgrade::Origins-Pattern { // Automatically reboot *WITHOUT CONFIRMATION* if // the file /var/run/reboot-required is found after the upgrade Unattended-Upgrade::Automatic-Reboot "true"; + +// If automatic reboot is enabled and needed, reboot at the specific +// time instead of immediately +Unattended-Upgrade::Automatic-Reboot-Time "02:00";