summaryrefslogtreecommitdiffstats
path: root/man/systemd-battery-check.service.xml
blob: 62d6bf566016cd51ea2abb49a715c0fd653a1958 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?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 -->

<refentry id="systemd-battery-check.service" xmlns:xi="http://www.w3.org/2001/XInclude">

  <refentryinfo>
    <title>systemd-battery-check</title>
    <productname>systemd</productname>
  </refentryinfo>

  <refmeta>
    <refentrytitle>systemd-battery-check.service</refentrytitle>
    <manvolnum>8</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>systemd-battery-check.service</refname>
    <refname>systemd-battery-check</refname>
    <refpurpose>Check battery level whether there's enough charge, and power off if not.</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <para><filename>systemd-battery-check.service</filename></para>
    <cmdsynopsis>
      <command>/usr/lib/systemd/systemd-battery-check</command>
      <arg choice="opt" rep="repeat">OPTIONS</arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>

    <para>
      <filename>systemd-battery-check.service</filename> is used to check the battery level during the early
      boot stage to determine whether there's sufficient battery 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>
  </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>

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

        <xi:include href="version-info.xml" xpointer="v254"/>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
    </para>
  </refsect1>

</refentry>