I like to use shutdown -h TIME/+DELAY sometimes. However, since the switch to systemd (on Ubuntu), things seem to have changed quite a bit.

Apart from the fact that a previous shutdown command no longer prevents running a new one, I can't figure out how to check for the planned shutdown time of a current shutdown process.

I used to just run ps aux | grep shutdown to see the planned shutdown time.

Now with systemd it just shows something like this:

root      5863  0.0  0.0  13300  1988 ?        Ss   09:04   0:00 /lib/systemd/systemd-shutdownd

How can I check the scheduled shutdown time of such a process?

I tried shutdown -k, but instead of only writing a wall message, it seems to also change the scheduled shutdown time to now+1 minute.

  • Me: "surely there's a simple way to view a pending shutdown, maybe some combination of arguments to shutdown that I overlooked?" SO: "here's a bunch of awk scripts, obsolete systemd invocations, and log parsing commands that might give you the info" Me: 😳
    – Tobias J
    Dec 30 '21 at 19:48

man shutdown(8) says:

The first argument may be a time string (which is usually "now").

The time string may either be in the format "hh:mm" for hour/minutes specifying the time to execute the shutdown at, specified in 24h clock format. Alternatively it may be in the syntax "+m" referring to the specified number of minutes m from now. "now" is an alias for "+0", i.e. for triggering an immediate shutdown. If no time argument is specified, "+1" is implied.


# shutdown +5
# systemctl status systemd-shutdownd.service

You should see something like this:

● systemd-shutdownd.service - Delayed Shutdown Service
Loaded: loaded (/lib/systemd/system/systemd-shutdownd.service; static; vendor preset: enabled)
Active: active (running) since Tue 2015-09-15 09:13:11 UTC; 12s ago
Docs: man:systemd-shutdownd.service(8)
Main PID: 965 (systemd-shutdow)
Status: "Shutting down at Tue 2015-09-15 09:18:11 UTC (poweroff)..."
CGroup: /system.slice/systemd-shutdownd.service
       └─965 /lib/systemd/systemd-shutdownd

Status is Shutting down at Tue 2015-09-15 09:18:11 UTC (poweroff)...

  • Thanks. That was easy. I tried "service status" without success before. I guess I'm not used to systemd enough yet.
    – KIAaze
    Sep 15 '15 at 9:46
  • 8
    systemd-shutdownd was removed from systemd in May 2015.
    – JdeBP
    Aug 28 '18 at 15:16
  • That's correct. Thank you for pointing it out. If a newer version of systemd is used, then something like the following should suffice: USECS=$(busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager ScheduledShutdown | cut -d ' ' -f 3); SECS=$((USECS / 1000000)); date --date=@$SECS. Aug 29 '18 at 9:02
# cat /run/systemd/shutdown/scheduled

The USEC is a unix epoch timestamp with microsecond precision, so:

if [ -f /run/systemd/shutdown/scheduled ]; then
  perl -wne 'm/^USEC=(\d+)\d{6}$/ and printf("Shutting down at: %s\n", scalar localtime $1)' < /run/systemd/shutdown/scheduled

will display something like:

Shutting down at: Tue Sep 18 03:50:00 2018

Systemd version is 232-25+deb9u4 running on Debian Stretch .


Most simple: (and working on Debian/Ubuntu)

date --date @$(head -1 /run/systemd/shutdown/scheduled |cut -c6-15)
  • 2
    Thanks. I found the systemctl method more intuitive, but since it stopped working, this seems to be the simplest solution for newer systems. (just tested on Kubuntu 20.04) Should I accept your answer instead now? Either way, it is here for whoever might need it now. :)
    – KIAaze
    May 20 '20 at 9:36
  • it's kind of weird, i have a schedule at 5:58PM which is 10hours from now, but using date it shows me 5:58, not 17:58
    – izzulmakin
    Mar 12 '21 at 1:04

For newer linux distributions versions you might need to do:

busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager ScheduledShutdown

The method of how shutdown works has changed

Tried on: - Debian Stretch 9.6 - Ubuntu 18.04.1 LTS


  • 3
    The output specifies the shutdown time as microseconds since the Unix epoch. To get a human-readable time: date -d @$(( $(busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager ScheduledShutdown | cut -d' ' -f3) / 1000000 )) Jan 31 '19 at 20:30

I encountered the same question and found another way to check the shutdown plan.

When you set a shutdown plan, wall will send a message to everybody logged in with their mesg permission set to yes. For every invocation of wall a notification will be written to syslog. To search the syslog, you could run the command journalctl -u systemd-shutdownd, the -u option could filter the log by unit.

When you run journalctl -u systemd-shutdownd, it will show the shutdown details like below:

[root@dev log]# journalctl -u systemd-shutdownd
-- Logs begin at Mon 2017-06-12 09:39:34 CST, end at Mon 2017-06-12 14:05:04 CST. --
Jun 12 09:39:50 dev.local systemd[1]: Started Delayed Shutdown Service.
Jun 12 09:39:50 dev.local systemd[1]: Starting Delayed Shutdown Service...
Jun 12 09:39:50 dev.local systemd-shutdownd[1249]: Shutting down at Mon 2017-06-12 21:00:00 CST (poweroff)...
Jun 12 09:55:59 dev.local systemd-shutdownd[1249]: Shutdown canceled.
Jun 12 09:56:07 dev.local systemd[1]: Started Delayed Shutdown Service.
Jun 12 09:56:07 dev.local systemd[1]: Starting Delayed Shutdown Service...
Jun 12 09:56:07 dev.local systemd-shutdownd[2885]: Shutdown canceled.
Jun 12 11:54:15 dev.local systemd[1]: Started Delayed Shutdown Service.
Jun 12 11:54:15 dev.local systemd[1]: Starting Delayed Shutdown Service...
Jun 12 11:54:15 dev.local systemd-shutdownd[3178]: Shutting down at Mon 2017-06-12 20:00:00 CST (poweroff)...

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.