battery-check: several follow-ups
Follow-ups for e3d4148d50909119c4e9327e6ad96d3ca7f4661a.
- add reference to initrd-battery-check.service in man page, and move
its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),
etc, etc...
2023-06-28 17:43:17 +00:00
|
|
|
<?xml version='1.0'?> <!--*-nxml-*-->
|
|
|
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
|
|
|
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
|
|
|
|
|
2023-06-30 15:09:21 +00:00
|
|
|
<refentry id="systemd-battery-check.service" xmlns:xi="http://www.w3.org/2001/XInclude">
|
battery-check: several follow-ups
Follow-ups for e3d4148d50909119c4e9327e6ad96d3ca7f4661a.
- add reference to initrd-battery-check.service in man page, and move
its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),
etc, etc...
2023-06-28 17:43:17 +00:00
|
|
|
|
|
|
|
<refentryinfo>
|
|
|
|
<title>systemd-battery-check</title>
|
|
|
|
<productname>systemd</productname>
|
|
|
|
</refentryinfo>
|
|
|
|
|
|
|
|
<refmeta>
|
2023-06-30 15:09:21 +00:00
|
|
|
<refentrytitle>systemd-battery-check.service</refentrytitle>
|
battery-check: several follow-ups
Follow-ups for e3d4148d50909119c4e9327e6ad96d3ca7f4661a.
- add reference to initrd-battery-check.service in man page, and move
its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),
etc, etc...
2023-06-28 17:43:17 +00:00
|
|
|
<manvolnum>8</manvolnum>
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
2023-06-30 15:09:21 +00:00
|
|
|
<refname>systemd-battery-check.service</refname>
|
battery-check: several follow-ups
Follow-ups for e3d4148d50909119c4e9327e6ad96d3ca7f4661a.
- add reference to initrd-battery-check.service in man page, and move
its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),
etc, etc...
2023-06-28 17:43:17 +00:00
|
|
|
<refname>systemd-battery-check</refname>
|
2023-11-06 13:59:00 +00:00
|
|
|
<refpurpose>Check battery level whether there's enough charge, and power off if not</refpurpose>
|
battery-check: several follow-ups
Follow-ups for e3d4148d50909119c4e9327e6ad96d3ca7f4661a.
- add reference to initrd-battery-check.service in man page, and move
its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),
etc, etc...
2023-06-28 17:43:17 +00:00
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
2023-06-30 15:09:21 +00:00
|
|
|
<para><filename>systemd-battery-check.service</filename></para>
|
battery-check: several follow-ups
Follow-ups for e3d4148d50909119c4e9327e6ad96d3ca7f4661a.
- add reference to initrd-battery-check.service in man page, and move
its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),
etc, etc...
2023-06-28 17:43:17 +00:00
|
|
|
<cmdsynopsis>
|
|
|
|
<command>/usr/lib/systemd/systemd-battery-check</command>
|
|
|
|
<arg choice="opt" rep="repeat">OPTIONS</arg>
|
|
|
|
</cmdsynopsis>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
2023-11-06 13:59:00 +00:00
|
|
|
<para>This service checks the presence of an external power supply and the battery level during the early
|
|
|
|
boot stage to determine whether there is sufficient power to carry on with the booting process.</para>
|
|
|
|
|
|
|
|
<para><command>systemd-battery-check</command> returns success if the device is connected to an AC power
|
|
|
|
source or if the battery charge is greater than 5%. It returns failure otherwise.</para>
|
battery-check: several follow-ups
Follow-ups for e3d4148d50909119c4e9327e6ad96d3ca7f4661a.
- add reference to initrd-battery-check.service in man page, and move
its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),
etc, etc...
2023-06-28 17:43:17 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Options</title>
|
|
|
|
|
|
|
|
<para>The following options are understood by <command>systemd-battery-check</command>:</para>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<xi:include href="standard-options.xml" xpointer="help" />
|
|
|
|
<xi:include href="standard-options.xml" xpointer="version" />
|
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Exit status</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
On success (running on AC power or battery capacity greater than 5%), 0 is returned, a non-zero failure
|
|
|
|
code otherwise.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2023-07-11 15:32:24 +00:00
|
|
|
<refsect1>
|
|
|
|
<title>Kernel Command Line</title>
|
|
|
|
|
|
|
|
<para>The following variables are understood:</para>
|
|
|
|
|
|
|
|
<variablelist class='kernel-commandline-options'>
|
|
|
|
<varlistentry>
|
|
|
|
<term><varname>systemd.battery-check=<replaceable>BOOL</replaceable></varname></term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Takes a boolean. If specified with false, <command>systemd-battery-check</command> command
|
|
|
|
will return immediately with exit status 0 without checking battery capacity and AC power
|
|
|
|
existence, and the service <filename>systemd-battery-check.service</filename> will succeed. This
|
|
|
|
may be useful when the command wrongly detects and reports battery capacity percentage or AC power
|
|
|
|
existence, or when you want to boot the system forcibly.</para>
|
2023-08-22 16:52:36 +00:00
|
|
|
|
|
|
|
<xi:include href="version-info.xml" xpointer="v254"/>
|
2023-07-11 15:32:24 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
battery-check: several follow-ups
Follow-ups for e3d4148d50909119c4e9327e6ad96d3ca7f4661a.
- add reference to initrd-battery-check.service in man page, and move
its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),
etc, etc...
2023-06-28 17:43:17 +00:00
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
<para>
|
|
|
|
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
</refentry>
|