2

I have been trying to determine if a shutdown has been scheduled in my system (Ubuntu 17.10). If I input via terminal "shutdown 100", it confirms that system will shut down at a time. But later on, how can I check which time it was if I have that terminal close already.

I found several solutions but none of them works:

ps -ef | grep shutdown

It shows shutdown all the time, even if shutdown has been cancelled.

systemctl status systemd-shutdownd.service

It seems it does not work anymore

cat /run/systemd/shutdown/scheduled

It returns the same either if there is shutdown pending or not.

  • 1
    How did you schedule the shut-down or how do you presume the shut-down was scheduled? – David Foerster Jan 10 '18 at 16:08
  • Through terminal. "shutdown 10". I cancel it with "shutdown -c". – Chema Rynld Jan 10 '18 at 16:53
  • 1
    Could you please edit your post, when you want to clarify something or add information? It’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks. – David Foerster Jan 10 '18 at 17:51
3

I've had success using

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

For example:

$ sudo shutdown -h +30                                                                                                                                                                                                                                                                                                           
Shutdown scheduled for Wed 2018-10-10 09:33:44 UTC, use 'shutdown -c' to cancel.
$ busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager ScheduledShutdown
(st) "poweroff" 1539164024057786
$ sudo shutdown -c
$ busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager ScheduledShutdown
(st) "" 0

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.