mirror of
https://github.com/systemd/systemd.git
synced 2025-03-14 04:58:28 +03:00
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.
This commit is contained in:
parent
43ee6a8128
commit
f886603b7e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user