mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
bsod: several cleanups
- add reference to the service unit in the man page, - fix several indentation and typos, - replace '(uint64_t) -1' with 'UINT64_MAX', - drop unnecessary 'continue'.
This commit is contained in:
parent
cf5d2df986
commit
c3c885a771
@ -902,7 +902,7 @@ manpages = [
|
|||||||
''],
|
''],
|
||||||
['systemd-boot-random-seed.service', '8', [], 'ENABLE_BOOTLOADER'],
|
['systemd-boot-random-seed.service', '8', [], 'ENABLE_BOOTLOADER'],
|
||||||
['systemd-boot', '7', ['sd-boot'], 'ENABLE_BOOTLOADER'],
|
['systemd-boot', '7', ['sd-boot'], 'ENABLE_BOOTLOADER'],
|
||||||
['systemd-bsod', '8', [], 'HAVE_QRENCODE'],
|
['systemd-bsod.service', '8', ['systemd-bsod'], 'HAVE_QRENCODE'],
|
||||||
['systemd-cat', '1', [], ''],
|
['systemd-cat', '1', [], ''],
|
||||||
['systemd-cgls', '1', [], ''],
|
['systemd-cgls', '1', [], ''],
|
||||||
['systemd-cgtop', '1', [], ''],
|
['systemd-cgtop', '1', [], ''],
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||||
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
|
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
|
||||||
|
|
||||||
<refentry id="systemd-bsod" conditional='HAVE_QRENCODE' xmlns:xi="http://www.w3.org/2001/XInclude">
|
<refentry id="systemd-bsod.service" conditional='HAVE_QRENCODE' xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||||
|
|
||||||
<refentryinfo>
|
<refentryinfo>
|
||||||
<title>systemd-bsod</title>
|
<title>systemd-bsod</title>
|
||||||
@ -11,16 +11,18 @@
|
|||||||
</refentryinfo>
|
</refentryinfo>
|
||||||
|
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle>systemd-bsod</refentrytitle>
|
<refentrytitle>systemd-bsod.service</refentrytitle>
|
||||||
<manvolnum>8</manvolnum>
|
<manvolnum>8</manvolnum>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
|
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
|
<refname>systemd-bsod.service</refname>
|
||||||
<refname>systemd-bsod</refname>
|
<refname>systemd-bsod</refname>
|
||||||
<refpurpose>Displays boot-time emergency log message full-screen.</refpurpose>
|
<refpurpose>Displays boot-time emergency log message in full screen.</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
|
<para><filename>systemd-bsod.service</filename></para>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>systemd-bsod</command>
|
<command>systemd-bsod</command>
|
||||||
<arg choice="opt" rep="repeat">OPTIONS</arg>
|
<arg choice="opt" rep="repeat">OPTIONS</arg>
|
||||||
@ -30,15 +32,15 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para><command>systemd-bsod</command> is used to display a blue screen which contains a message relating to
|
<para><filename>systemd-bsod.service</filename> is used to display a blue screen which contains a message
|
||||||
a boot failure, including a QR code which users can scan with their phones to get helpful information
|
relating to a boot failure, including a QR code which can be scanned to get helpful information about the
|
||||||
about the cause of their boot failure.</para>
|
failure.</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Options</title>
|
<title>Options</title>
|
||||||
|
|
||||||
<para>The following options are understood:</para>
|
<para>The following options are understood by <command>systemd-bsod</command>:</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<xi:include href="standard-options.xml" xpointer="help" />
|
<xi:include href="standard-options.xml" xpointer="help" />
|
||||||
@ -48,8 +50,8 @@
|
|||||||
<term><option>-c</option></term>
|
<term><option>-c</option></term>
|
||||||
<term><option>--continuous</option></term>
|
<term><option>--continuous</option></term>
|
||||||
|
|
||||||
<listitem><para> Used to make systemd-bsod wait continuously for changes in the
|
<listitem><para>When specified, <command>systemd-bsod</command> waits continuously for changes in the
|
||||||
journal's status if doesn't find any emergency messages on initial attempt.</para></listitem>
|
journal if it doesn't find any emergency messages on the initial attempt.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
|
@ -77,7 +77,7 @@ static int acquire_first_emergency_log_message(char **ret) {
|
|||||||
|
|
||||||
r = sd_journal_seek_head(j);
|
r = sd_journal_seek_head(j);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to seek to start of jornal: %m");
|
return log_error_errno(r, "Failed to seek to start of journal: %m");
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
r = sd_journal_next(j);
|
r = sd_journal_next(j);
|
||||||
@ -92,11 +92,9 @@ static int acquire_first_emergency_log_message(char **ret) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = sd_journal_wait(j, (uint64_t) -1);
|
r = sd_journal_wait(j, UINT64_MAX);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to wait for changes: %m");
|
return log_error_errno(r, "Failed to wait for changes: %m");
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r = sd_journal_get_data(j, "MESSAGE", &d, &l);
|
r = sd_journal_get_data(j, "MESSAGE", &d, &l);
|
||||||
@ -254,6 +252,7 @@ static int parse_argv(int argc, char * argv[]) {
|
|||||||
default:
|
default:
|
||||||
assert_not_reached();
|
assert_not_reached();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optind < argc)
|
if (optind < argc)
|
||||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||||
"%s takes no argument.",
|
"%s takes no argument.",
|
||||||
|
@ -74,6 +74,7 @@ executables += [
|
|||||||
},
|
},
|
||||||
libexec_template + {
|
libexec_template + {
|
||||||
'name' : 'systemd-bsod',
|
'name' : 'systemd-bsod',
|
||||||
|
'public' : true,
|
||||||
'conditions' : ['HAVE_QRENCODE'],
|
'conditions' : ['HAVE_QRENCODE'],
|
||||||
'sources' : files('bsod.c'),
|
'sources' : files('bsod.c'),
|
||||||
'link_with' : libshared,
|
'link_with' : libshared,
|
||||||
|
@ -8,13 +8,13 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Displays emergency message full screen.
|
Description=Displays emergency message in full screen.
|
||||||
Documentation=man:systemd-bsod(8)
|
Documentation=man:systemd-bsod.service(8)
|
||||||
ConditionVirtualization=no
|
ConditionVirtualization=no
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Conflicts=shutdown.target
|
|
||||||
Before=shutdown.target
|
|
||||||
After=systemd-battery-check.service
|
After=systemd-battery-check.service
|
||||||
|
Before=shutdown.target
|
||||||
|
Conflicts=shutdown.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
Loading…
Reference in New Issue
Block a user