问题原文
原帖链接 · UlfR · CC BY-SA 3.0
Where can I find information about if there is an reboot scheduled and in that case: when, why and by who?
I got this in my terminal:
Broadcast message from root@my-server (Tue 2017-11-07 09:00:00 CET):
The system is going down for reboot at Wed 2017-11-08 02:00:00 CET!
So in a couple of hours the system will be rebooted, that's good. But after working for a while and the message is scrolled out of visibility or if the terminal is closed:
How can I get hold of the reboot time?
If I again login to the server I only get the message:
*** System restart required ***
There is no information about the upcoming reboot. I have tried to see if there is any shutdown processes running, but could not find any.
I know I could produce a similar message by issuing a command like this:
sudo shutdown -r 02:00
So, how do I find information about any upcoming reboots?
已采纳解答
原帖链接 · htaccess · CC BY-SA 4.0
On an Ubuntu 18.04 machine shutdown is managed by systemd. On my machine I have enabled automatic reboots via unattended upgrades:
$ grep Automatic-Reboot /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
The scheduled automatic reboot time is stored in /run/systemd/shutdown/scheduled.
$ cat /run/systemd/shutdown/scheduled
USEC=1563976800000000
WARN_WALL=1
MODE=reboot
You can convert this to a human readable time using the following command:
$ date -d "@$( awk -F '=' '/USEC/{ $2=substr($2,1,10); print $2 }' /run/systemd/shutdown/scheduled )"
Thu Jul 25 02:00:00 NZST 2019
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
