summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2023-01-24 00:13:23 +0800
committerMike Yuan <me@yhndnzj.com>2023-01-24 00:13:23 +0800
commitd2493703c19437fc4ae3f9c40202e8c4b314d517 (patch)
treef2a9ee25a625e746cadaf8d01596be73cf5f647d /src/machine
parente830d6dd2d76ecd3881e5c14bddc23f8cddfd137 (diff)
downloadsystemd-d2493703c19437fc4ae3f9c40202e8c4b314d517.tar.gz
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.
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/machinectl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 149b5d8e60..b9e3848d18 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;