summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2018-06-13 07:58:05 +0200
committerSven Eden <yamakuzure@gmx.net>2018-06-29 07:12:51 +0200
commitfe54c6a8e4ca5627d318066d29f18ece89e76968 (patch)
tree72147b49e7207af29aaf056f63b67374efa71929 /src
parent04164a6f685a6870e81190ee7c287f9195d16e6c (diff)
Add dry_run support to manager_scheduled_shutdown_handler()
Diffstat (limited to 'src')
-rw-r--r--src/login/elogind-dbus.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/login/elogind-dbus.c b/src/login/elogind-dbus.c
index baa36b1f2..2bb8228f1 100644
--- a/src/login/elogind-dbus.c
+++ b/src/login/elogind-dbus.c
@@ -442,6 +442,19 @@ int manager_scheduled_shutdown_handler(
return -EALREADY;
}
+ if (m->shutdown_dry_run) {
+ /* We do not process delay inhibitors here. Otherwise, we
+ * would have to be considered "in progress" (like the check
+ * above) for some seconds after our admin has seen the final
+ * wall message. */
+
+ bus_manager_log_shutdown(m, target);
+ log_info("Running in dry run, suppressing action.");
+ reset_scheduled_shutdown(m);
+
+ return 0;
+ }
+
r = execute_shutdown_or_sleep(m, 0, action, &error);
if (r < 0)
return log_error_errno(r, "Scheduled shutdown to %s failed: %m",