systemd: How to check scheduled time of a delayed shutdown?
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.
systemd shutdown
add a comment |
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.
systemd shutdown
add a comment |
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.
systemd shutdown
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.
systemd shutdown
systemd shutdown
edited Jun 13 at 16:03
U880D
399414
399414
asked Sep 15 '15 at 8:09
KIAaze
273213
273213
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
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.
Try:
# 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
systemd-shutdownd
was removed from systemd in May 2015.
– JdeBP
Aug 28 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
.
– Evgeny Vereshchagin
Aug 29 at 9:02
add a comment |
I encountered the same question and found another way to check the shutdown plan, hope it will help others.
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)...
add a comment |
# cat /run/systemd/shutdown/scheduled
USEC=1537242600000000
WARN_WALL=1
MODE=poweroff
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: %sn", scalar localtime $1)' < /run/systemd/shutdown/scheduled
fi
will display something like:
Shutting down at: Tue Sep 18 03:50:00 2018
Systemd version is 232-25+deb9u4 running on Debian Stretch .
add a comment |
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
References
- Check if shutdown schedule is active and when it is
- The shutdown program on a modern systemd-based Linux system
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f229745%2fsystemd-how-to-check-scheduled-time-of-a-delayed-shutdown%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Try:
# 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
systemd-shutdownd
was removed from systemd in May 2015.
– JdeBP
Aug 28 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
.
– Evgeny Vereshchagin
Aug 29 at 9:02
add a comment |
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.
Try:
# 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
systemd-shutdownd
was removed from systemd in May 2015.
– JdeBP
Aug 28 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
.
– Evgeny Vereshchagin
Aug 29 at 9:02
add a comment |
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.
Try:
# 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)...
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.
Try:
# 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)...
answered Sep 15 '15 at 9:15
Evgeny Vereshchagin
3,24242236
3,24242236
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
systemd-shutdownd
was removed from systemd in May 2015.
– JdeBP
Aug 28 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
.
– Evgeny Vereshchagin
Aug 29 at 9:02
add a comment |
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
systemd-shutdownd
was removed from systemd in May 2015.
– JdeBP
Aug 28 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
.
– Evgeny Vereshchagin
Aug 29 at 9:02
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
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
systemd-shutdownd
was removed from systemd in May 2015.– JdeBP
Aug 28 at 15:16
systemd-shutdownd
was removed from systemd in May 2015.– JdeBP
Aug 28 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
.– Evgeny Vereshchagin
Aug 29 at 9:02
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
.– Evgeny Vereshchagin
Aug 29 at 9:02
add a comment |
I encountered the same question and found another way to check the shutdown plan, hope it will help others.
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)...
add a comment |
I encountered the same question and found another way to check the shutdown plan, hope it will help others.
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)...
add a comment |
I encountered the same question and found another way to check the shutdown plan, hope it will help others.
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)...
I encountered the same question and found another way to check the shutdown plan, hope it will help others.
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)...
answered Jun 12 '17 at 8:54
Key Shang
216129
216129
add a comment |
add a comment |
# cat /run/systemd/shutdown/scheduled
USEC=1537242600000000
WARN_WALL=1
MODE=poweroff
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: %sn", scalar localtime $1)' < /run/systemd/shutdown/scheduled
fi
will display something like:
Shutting down at: Tue Sep 18 03:50:00 2018
Systemd version is 232-25+deb9u4 running on Debian Stretch .
add a comment |
# cat /run/systemd/shutdown/scheduled
USEC=1537242600000000
WARN_WALL=1
MODE=poweroff
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: %sn", scalar localtime $1)' < /run/systemd/shutdown/scheduled
fi
will display something like:
Shutting down at: Tue Sep 18 03:50:00 2018
Systemd version is 232-25+deb9u4 running on Debian Stretch .
add a comment |
# cat /run/systemd/shutdown/scheduled
USEC=1537242600000000
WARN_WALL=1
MODE=poweroff
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: %sn", scalar localtime $1)' < /run/systemd/shutdown/scheduled
fi
will display something like:
Shutting down at: Tue Sep 18 03:50:00 2018
Systemd version is 232-25+deb9u4 running on Debian Stretch .
# cat /run/systemd/shutdown/scheduled
USEC=1537242600000000
WARN_WALL=1
MODE=poweroff
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: %sn", scalar localtime $1)' < /run/systemd/shutdown/scheduled
fi
will display something like:
Shutting down at: Tue Sep 18 03:50:00 2018
Systemd version is 232-25+deb9u4 running on Debian Stretch .
answered Sep 17 at 21:04
Delian Krustev
1112
1112
add a comment |
add a comment |
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
References
- Check if shutdown schedule is active and when it is
- The shutdown program on a modern systemd-based Linux system
add a comment |
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
References
- Check if shutdown schedule is active and when it is
- The shutdown program on a modern systemd-based Linux system
add a comment |
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
References
- Check if shutdown schedule is active and when it is
- The shutdown program on a modern systemd-based Linux system
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
References
- Check if shutdown schedule is active and when it is
- The shutdown program on a modern systemd-based Linux system
answered 25 mins ago
akarapatis
1011
1011
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f229745%2fsystemd-how-to-check-scheduled-time-of-a-delayed-shutdown%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown