From f886603b7eba6a11b7b48d8b6b04a05aaa960b1a Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Wed, 16 Aug 2017 18:09:47 +0100 Subject: [PATCH] systemctl: don't allow --wait with commands that might not start units There's no good reason to use `--wait` with ReloadOrRestartUnit, or TryRestartUnit. The message was also wrong in another sense. 'systemctl isolate' starts units, but it did not support `--wait`. Although it's unlikely anyone would want to do that in the first place. --- src/systemctl/systemctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 36675dc..9b0fe1b 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3068,8 +3068,8 @@ static int start_unit(int argc, char *argv[], void *userdata) { char **name; int r = 0; - if (arg_wait && !strstr(argv[0], "start")) { - log_error("--wait may only be used with a command that starts units."); + if (arg_wait && !STR_IN_SET(argv[0], "start", "restart")) { + log_error("--wait may only be used with the 'start' or 'restart' commands."); return -EINVAL; } -- 2.7.4