summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-02-09 12:12:30 +0100
committerLennart Poettering <lennart@poettering.net>2011-02-09 12:12:30 +0100
commit0658666bacde7decbc362f0f589fe6aa5251faba (patch)
tree68810fe51916361bf655a2aa73680e52c83dfbce
parentbe0396695bae9227ad69fcb61066bd84b3974e16 (diff)
manager: if we receive SIGRTMIN+20/21 enable/disable showing of status on the console
-rw-r--r--man/systemd.xml57
-rw-r--r--src/manager.c18
2 files changed, 74 insertions, 1 deletions
diff --git a/man/systemd.xml b/man/systemd.xml
index c6c06e57e9..88904b7a09 100644
--- a/man/systemd.xml
+++ b/man/systemd.xml
@@ -720,6 +720,63 @@
<command>systemctl start
reboot.target</command>.</para></listitem>
</varlistentry>
+
+ <varlistentry>
+ <term>SIGRTMIN+6</term>
+
+ <listitem><para>Reboots the machine via kexec,
+ starts the
+ <filename>kexec.target</filename>
+ unit. This is mostly equivalent to
+ <command>systemctl start
+ kexec.target</command>.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>SIGRTMIN+13</term>
+
+ <listitem><para>Immediately halts the machine.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>SIGRTMIN+14</term>
+
+ <listitem><para>Immediately powers off the machine.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>SIGRTMIN+15</term>
+
+ <listitem><para>Immediately reboots the machine.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>SIGRTMIN+16</term>
+
+ <listitem><para>Immediately reboots the machine with kexec.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>SIGRTMIN+20</term>
+
+ <listitem><para>Enables display of
+ status messages on the console, as
+ controlled via
+ <varname>systemd.show_status=1</varname>
+ on the kernel command
+ line.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>SIGRTMIN+21</term>
+
+ <listitem><para>Disables display of
+ status messages on the console, as
+ controlled via
+ <varname>systemd.show_status=0</varname>
+ on the kernel command
+ line.</para></listitem>
+ </varlistentry>
</variablelist>
</refsect1>
diff --git a/src/manager.c b/src/manager.c
index 2714df1152..4a8408212a 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)));
+ }
}
}
}