manager: if we receive SIGRTMIN+20/21 enable/disable showing of status on the console

This commit is contained in:
Lennart Poettering 2011-02-09 12:12:30 +01:00
parent be0396695b
commit 0658666bac
2 changed files with 74 additions and 1 deletions

View File

@ -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>

View File

@ -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)));
}
}
}
}