大网数据广告活动
服务器运维问答

When is system scheduled for reboot?

· 52CE 我爱测

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 f…

问题原文

原帖链接 · 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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-11-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。