systemctl: honour --dry-run also on logind calls

Fixes #7670.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-03-08 11:57:59 +01:00
parent d23b5ce2b6
commit dbc9830cde

View 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",