From: Mike Yuan Date: Mon, 23 Jan 2023 16:13:23 +0000 (+0800) Subject: machinectl: also enable machines.target when enabling machines X-Git-Tag: v253-rc1~23^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2493703c19437fc4ae3f9c40202e8c4b314d517;p=thirdparty%2Fsystemd.git machinectl: also enable machines.target when enabling machines It's mostly desired to enable machines.target along with the machine since only when both are enabled it would really work. --- diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 149b5d8e609..b9e3848d182 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -1616,6 +1616,12 @@ static int enable_machine(int argc, char *argv[], void *userdata) { if (r < 0) return bus_log_create_error(r); + if (streq(argv[0], "enable")) { + r = sd_bus_message_append(m, "s", "machines.target"); + if (r < 0) + return bus_log_create_error(r); + } + for (int i = 1; i < argc; i++) { _cleanup_free_ char *unit = NULL;