[systemd-commits] 2 commits - man/systemd.xml src/main.c src/manager.c units/plymouth-start.service
Lennart Poettering
lennart at kemper.freedesktop.org
Wed Feb 9 05:18:00 PST 2011
man/systemd.xml | 57 +++++++++++++++++++++++++++++++++++++++++++
src/main.c | 5 +++
src/manager.c | 18 ++++++++++++-
units/plymouth-start.service | 6 ++++
4 files changed, 85 insertions(+), 1 deletion(-)
New commits:
commit e1b2b49465615727a2c3883d06d1b9ff339aec67
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 9 14:17:52 2011 +0100
systemd: show status when run with plymouth, and don't start plymouth a second time when it is already running
diff --git a/src/main.c b/src/main.c
index 0f82b70..d1eeffb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -985,6 +985,11 @@ int main(int argc, char *argv[]) {
if (parse_argv(argc, argv) < 0)
goto finish;
+ /* If Plymouth is being run make sure we show the status, so
+ * that there's something nice to see when people press Esc */
+ if (access("/dev/.systemd/plymouth", F_OK) >= 0)
+ arg_show_status = true;
+
if (arg_action == ACTION_HELP) {
retval = help();
goto finish;
diff --git a/units/plymouth-start.service b/units/plymouth-start.service
index 61cb82c..c3c101e 100644
--- a/units/plymouth-start.service
+++ b/units/plymouth-start.service
@@ -12,7 +12,13 @@ Wants=systemd-ask-password-plymouth.path
After=systemd-vconsole-setup.service udev-settle.service
Before=systemd-ask-password-plymouth.service
+# Dracut informs us with this flag file if plymouth is already running
+ConditionPathExists=!/dev/.systemd/plymouth
+
[Service]
ExecStart=/sbin/plymouthd --mode=boot
ExecStartPost=-/bin/plymouth --show-splash
Type=forking
+
+# Send SIGRTMIN+20 to systemd, i.e. enable status messages
+ExecStartPost=-/usr/bin/kill -54 1
commit 0658666bacde7decbc362f0f589fe6aa5251faba
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 9 12:12:30 2011 +0100
manager: if we receive SIGRTMIN+20/21 enable/disable showing of status on the console
diff --git a/man/systemd.xml b/man/systemd.xml
index c6c06e5..88904b7 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 2714df1..4a84082 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)));
+ }
}
}
}
More information about the systemd-commits
mailing list