无人值守升级触发静默重启

无人值守升级触发静默重启

过去几周里,有几次我在工作时突然桌面消失了,并且我的机器完全重新启动了。

今天早上又发生了一次,我追踪了系统日志,发现最接近的可能相关的事件是unattended-upgrades.service: Succeeded

Jul 14 10:02:42 pc charon: 05[NET] sending packet: from 192.168.1.214[4500] to 123.321.123.321[4500] (92 bytes)
Jul 14 10:03:02 pc charon: 08[IKE] sending keep alive to 123.321.123.321[4500]
Jul 14 10:03:03 pc systemd[1]: unattended-upgrades.service: Succeeded.
Jul 14 10:03:03 pc systemd[1]: Stopping Session 2 of user philip.
Jul 14 10:03:03 pc systemd[1]: Removed slice system-clean\x2dmount\x2dpoint.slice.
Jul 14 10:03:03 pc systemd[1]: Removed slice system-getty.slice.
Jul 14 10:03:03 pc systemd[2039]: Stopped target GNOME Wayland Session (session: gnome).
Jul 14 10:03:03 pc systemd[2039]: Stopped target GNOME Session.
Jul 14 10:03:03 pc systemd[2039]: Stopped target GNOME Wayland Session.
Jul 14 10:03:03 pc systemd[2039]: Stopped target GNOME Session (session: gnome).
Jul 14 10:03:03 pc systemd[2039]: Stopped target GNOME Accessibility settings.
Jul 14 10:03:03 pc systemd[2039]: Stopped target GNOME Color management.
Jul 14 10:03:03 pc systemd[2039]: Stopped target GNOME Date & Time handling.
Jul 14 10:03:03 pc systemd[2039]: Stopped target GNOME Maintenance of expirable data.

我通常不反对无人值守升级,但无警告的静默重启确实很糟糕。今天早上我打开了 15 个窗口,正在调试一些棘手的代码。我花了 30 分钟才回到原来的位置。

无人值守升级的静默重启是正常的/可配置的吗?

有什么推荐的方法可以阻止此重启发生?


奇怪的是,这似乎没有配置成这样做:

$ grep -irnC2 reboot /etc/apt/apt.conf.d/
/etc/apt/apt.conf.d/50unattended-upgrades-90-//Unattended-Upgrade::Remove-Unused-Dependencies "false";
/etc/apt/apt.conf.d/50unattended-upgrades-91-
/etc/apt/apt.conf.d/50unattended-upgrades:92:// Automatically reboot *WITHOUT CONFIRMATION* if
/etc/apt/apt.conf.d/50unattended-upgrades:93://  the file /var/run/reboot-required is found after the upgrade
/etc/apt/apt.conf.d/50unattended-upgrades:94://Unattended-Upgrade::Automatic-Reboot "false";
/etc/apt/apt.conf.d/50unattended-upgrades-95-
/etc/apt/apt.conf.d/50unattended-upgrades:96:// Automatically reboot even if there are users currently logged in
/etc/apt/apt.conf.d/50unattended-upgrades:97:// when Unattended-Upgrade::Automatic-Reboot is set to true
/etc/apt/apt.conf.d/50unattended-upgrades:98://Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
/etc/apt/apt.conf.d/50unattended-upgrades-99-
/etc/apt/apt.conf.d/50unattended-upgrades:100:// If automatic reboot is enabled and needed, reboot at the specific
/etc/apt/apt.conf.d/50unattended-upgrades-101-// time instead of immediately
/etc/apt/apt.conf.d/50unattended-upgrades-102-//  Default: "now"
/etc/apt/apt.conf.d/50unattended-upgrades:103://Unattended-Upgrade::Automatic-Reboot-Time "02:00";
/etc/apt/apt.conf.d/50unattended-upgrades-104-
/etc/apt/apt.conf.d/50unattended-upgrades-105-// Use apt bandwidth limit feature, this example limits the download

答案1

无人值守升级是否重新启动系统由配置文件中的条目控制/etc/apt/apt.conf.d/50unattended-upgrades

我的设置为不允许重新启动(默认),文件的相关部分如下所示

// Automatically reboot *WITHOUT CONFIRMATION*
//  if the file /var/run/reboot-required is found after the upgrade 
//Unattended-Upgrade::Automatic-Reboot "false";

// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
//  Default: "now"
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";

相关内容