From 130246d2e8d7a0c91dbaa1110fa7a6d6e6f86a50 Mon Sep 17 00:00:00 2001
From: Guillem Jover <gjover@sipwise.com>
Date: Fri, 29 Sep 2017 16:07:11 +0200
Subject: [PATCH] systemctl: make sure legacy "reboot", "suspend" and friends are
 always asynchronous

Currently, "reboot" behaves differently in setups with and without logind.
If logind is used (which is probably the more common case) the operation
is asynchronous, we should behave in the same way as "systemctl <verb>".
Let's clean this up, and always expose the same behaviour, regardless if
logind is used or not: let's always make it asynchronous.

See: #6479
Fixes: 130246d2e8d7a0c91dbaa1110fa7a6d6e6f86a50
---
 src/systemctl/systemctl.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -8606,7 +8606,12 @@ static int halt_main(void) {
                                  * supported on the local system or
                                  * already in progress */
                                 return r;
-                        /* on all other errors, try low-level operation */
+
+                        /* On all other errors, try low-level operation. In order to minimize the difference between
+                         * operation with and without logind, we explicitly enable non-blocking mode for this, as
+                         * logind's shutdown operations are always non-blocking. */
+
+                        arg_no_block = true;
                 }
         }
 
