Score:3

Can unattended upgrade shutdown my Ubuntu Server?

in flag

My server unexpectedly powered down today. From syslog, it seems like it might have been the unattended upgrade service:

Nov 22 15:23:25 lynx systemd[1]: unattended-upgrades.service: Succeeded.
Nov 22 15:23:25 lynx systemd[1]: Removed slice system-modprobe.slice.
Nov 22 15:23:25 lynx systemd[1]: Stopped target Graphical Interface.
Nov 22 15:23:25 lynx systemd[1]: Stopped target Multi-User System.
Nov 22 15:23:25 lynx systemd[1]: Stopped target Login Prompts.
Nov 22 15:23:25 lynx systemd[1]: Stopped target Host and Network Name Lookups.
Nov 22 15:23:25 lynx systemd[1]: Stopped target Timers.
...
etc

The omitted parts are a list of various services that systemd is shutting down. If I look at the output of last:

$ last -x | head | tac
...
shutdown system down  5.4.0-90-generic Mon Nov 22 15:23 - 17:14  (01:51)
reboot   system boot  5.4.0-90-generic Mon Nov 22 17:14   still running
runlevel (to lvl 5)   5.4.0-90-generic Mon Nov 22 17:15   still running

I can see that the shutdown was properly logged to the system, and then you can see 2 hours later when I noticed the machine was down and rebooted it. My question is two fold - Why did this happen, and how do I configure this? I've been running this machine for years and I don't think I can recall it ever shutting down for an update before. The logs make me think it was unattended upgrade that did this, but I'm not sure how to verify that. If I understood how to configure unattended upgrade's settings/options I might notice something that controls it rebooting or shutting down, which is why I want to know how to do that. I'd prefer to either disable this (no shutdown) or change it to reboot (if the machine is on, I want it to stay on!). Any suggestions?

uz flag
Jos
A server occasionally reboots because of unattended upgrades, but (1) it always restarts, doesn't just shut down; (2) it happens at 3:00 AM, certainly not in the middle of the day; and (3) you get a warning every hour on the hour the day before it happens, whenever you use a terminal. Moreover, you get an email warning if you have configured these. So I don't think this is an unattended-upgrades issue.
in flag
I'm happy to post more of the syslog, but I don't see anything else that looks remotely related :(
uz flag
Jos
Have you looked at [this](https://askubuntu.com/questions/1308468/ubuntu-server-shuts-down-daily) question? Does `sudo journalctl -b -1 -e ` give any interesting output?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.