From 0658666bacde7decbc362f0f589fe6aa5251faba Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 9 Feb 2011 12:12:30 +0100 Subject: [PATCH] manager: if we receive SIGRTMIN+20/21 enable/disable showing of status on the console --- man/systemd.xml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ src/manager.c | 18 +++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/man/systemd.xml b/man/systemd.xml index c6c06e57..88904b7a 100644 --- a/man/systemd.xml +++ b/man/systemd.xml @@ -720,6 +720,63 @@ systemctl start reboot.target. + + + SIGRTMIN+6 + + Reboots the machine via kexec, + starts the + kexec.target + unit. This is mostly equivalent to + systemctl start + kexec.target. + + + + SIGRTMIN+13 + + Immediately halts the machine. + + + + SIGRTMIN+14 + + Immediately powers off the machine. + + + + SIGRTMIN+15 + + Immediately reboots the machine. + + + + SIGRTMIN+16 + + Immediately reboots the machine with kexec. + + + + SIGRTMIN+20 + + Enables display of + status messages on the console, as + controlled via + systemd.show_status=1 + on the kernel command + line. + + + + SIGRTMIN+21 + + Disables display of + status messages on the console, as + controlled via + systemd.show_status=0 + on the kernel command + line. + diff --git a/src/manager.c b/src/manager.c index 2714df11..4a840821 100644 --- a/src/manager.c +++ b/src/manager.c @@ -174,6 +174,8 @@ static int manager_setup_signals(Manager *m) { SIGRTMIN+14, /* systemd: Immediate poweroff */ SIGRTMIN+15, /* systemd: Immediate reboot */ SIGRTMIN+16, /* systemd: Immediate kexec */ + SIGRTMIN+20, /* systemd: enable status messages */ + SIGRTMIN+21, /* systemd: disable status messages */ -1); assert_se(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); @@ -2177,7 +2179,21 @@ static int manager_process_signal_fd(Manager *m) { break; } - log_warning("Got unhandled signal <%s>.", strna(signal_to_string(sfsi.ssi_signo))); + switch (sfsi.ssi_signo - SIGRTMIN) { + + case 20: + log_debug("Enabling showing of status."); + m->show_status = true; + break; + + case 21: + log_debug("Disabling showing of status."); + m->show_status = false; + break; + + default: + log_warning("Got unhandled signal <%s>.", strna(signal_to_string(sfsi.ssi_signo))); + } } } } -- 2.39.5