summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/login/eloginctl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/login/eloginctl.c b/src/login/eloginctl.c
index 0b4dc84b4..dd0a89d38 100644
--- a/src/login/eloginctl.c
+++ b/src/login/eloginctl.c
@@ -299,12 +299,15 @@ static int elogind_reboot(sd_bus *bus, enum elogind_action a) {
}
polkit_agent_open_if_enabled();
- r = elogind_set_wall_message(bus, table[a]);
- if (r < 0) {
- log_warning_errno(r, "Failed to set wall message, ignoring: %s",
- bus_error_message(&error, r));
- sd_bus_error_free(&error);
+ if ( IN_SET(a, ACTION_POWEROFF, ACTION_REBOOT) ) {
+ r = elogind_set_wall_message(bus, table[a]);
+
+ if (r < 0) {
+ log_warning_errno(r, "Failed to set wall message, ignoring: %s",
+ bus_error_message(&error, r));
+ sd_bus_error_free(&error);
+ }
}
/* Now call elogind itself to request the operation */