diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 2a385bf3503..dd0ebff1793 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3585,8 +3585,16 @@ static int start_special(int argc, char *argv[], void *userdata) { /* requested operation is not supported 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; + + } else if (IN_SET(a, ACTION_EXIT, ACTION_KEXEC)) + /* Since exit/kexec are so close in behaviour to power-off/reboot, let's also make them + * asynchronous, in order to not confuse the user needlessly with unexpected behaviour. */ + arg_no_block = true; r = start_unit(argc, argv, userdata); }