summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-24 12:24:35 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-29 21:55:52 +0200
commit48ec22bc02921ae6324f5ec1373244437fb4a6fb (patch)
tree56118602ec148a5dc658ac3c9c945fd1526e90ac
parente3ead6bb42f7c0f18d0ac100d33b71913fe4dcca (diff)
systemctl: remove client-side wall message support
logind sends out wall messages now, let's remove this from the systemctl client side hence. If people build systemd without logind support they won't get wall messages now, but that's OK.
-rw-r--r--src/systemctl/systemctl.c49
1 files changed, 3 insertions, 46 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 059e51c2cd..421443fef3 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -223,41 +223,6 @@ static int translate_bus_error_to_exit_status(int r, const sd_bus_error *error)
return EXIT_FAILURE;
}
-static void warn_wall(enum action a) {
- static const char *table[_ACTION_MAX] = {
- [ACTION_HALT] = "The system is going down for system halt NOW!",
- [ACTION_REBOOT] = "The system is going down for reboot NOW!",
- [ACTION_POWEROFF] = "The system is going down for power-off NOW!",
- [ACTION_KEXEC] = "The system is going down for kexec reboot NOW!",
- [ACTION_RESCUE] = "The system is going down to rescue mode NOW!",
- [ACTION_EMERGENCY] = "The system is going down to emergency mode NOW!",
- [ACTION_CANCEL_SHUTDOWN] = "The system shutdown has been cancelled NOW!"
- };
-
- if (arg_no_wall)
- return;
-
- if (arg_wall) {
- _cleanup_free_ char *p;
-
- p = strv_join(arg_wall, " ");
- if (!p) {
- log_oom();
- return;
- }
-
- if (*p) {
- utmp_wall(p, NULL, NULL, NULL, NULL);
- return;
- }
- }
-
- if (!table[a])
- return;
-
- utmp_wall(table[a], NULL, NULL, NULL, NULL);
-}
-
static bool avoid_bus(void) {
/* /sbin/runlevel doesn't need to communicate via D-Bus, so
@@ -3094,11 +3059,7 @@ static int start_special(sd_bus *bus, char **args) {
/* on all other errors, try low-level operation */
}
- r = start_unit(bus, args);
- if (r == EXIT_SUCCESS)
- warn_wall(a);
-
- return r;
+ return start_unit(bus, args);
}
static int check_unit_generic(sd_bus *bus, int code, const char *good_states, char **args) {
@@ -7367,20 +7328,16 @@ static int start_with_fallback(sd_bus *bus) {
if (bus) {
/* First, try systemd via D-Bus. */
if (start_unit(bus, NULL) >= 0)
- goto done;
+ return 0;
}
/* Nothing else worked, so let's try
* /dev/initctl */
if (talk_initctl() > 0)
- goto done;
+ return 0;
log_error("Failed to talk to init daemon.");
return -EIO;
-
-done:
- warn_wall(arg_action);
- return 0;
}
static int halt_now(enum action a) {