]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: honour --dry-run also on logind calls 8399/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 8 Mar 2018 10:57:59 +0000 (11:57 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 9 Mar 2018 09:43:54 +0000 (10:43 +0100)
Fixes #7670.

src/systemctl/systemctl.c

index 393c35c60fe177252ff08a6c091431f00945f774..6ae97cf1076b9d5eb33a2a8317ba0e5fae9187f2 100644 (file)
@@ -2915,8 +2915,8 @@ static int start_unit_one(
                         return log_error_errno(r, "Failed to request match for PropertiesChanged signal: %m");
         }
 
-        log_debug("%s manager for %s on %s, %s",
-                  arg_dry_run ? "Would call" : "Calling",
+        log_debug("%s dbus call org.freedesktop.systemd1.Manager %s(%s, %s)",
+                  arg_dry_run ? "Would execute" : "Executing",
                   method, name, mode);
         if (arg_dry_run)
                 return 0;
@@ -3215,6 +3215,10 @@ static int logind_set_wall_message(void) {
         if (!m)
                 return log_oom();
 
+        log_debug("%s wall message \"%s\".", arg_dry_run ? "Would set" : "Setting", m);
+        if (arg_dry_run)
+                return 0;
+
         r = sd_bus_call_method(
                         bus,
                         "org.freedesktop.login1",
@@ -3285,6 +3289,10 @@ static int logind_reboot(enum action a) {
         polkit_agent_open_maybe();
         (void) logind_set_wall_message();
 
+        log_debug("%s org.freedesktop.login1.Manager %s dbus call.", arg_dry_run ? "Would execute" : "Executing", method);
+        if (arg_dry_run)
+                return 0;
+
         r = sd_bus_call_method(
                         bus,
                         "org.freedesktop.login1",