[7efbf3d1] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[8dfc5c3] | 7 | <!ENTITY acpid-download-http "&sourceforge-dl;/acpid2/acpid-&acpid-version;.tar.xz">
|
---|
[7efbf3d1] | 8 | <!ENTITY acpid-download-ftp " ">
|
---|
[2faedff] | 9 | <!ENTITY acpid-md5sum "988c2e3fd5ba0ea4492d3ba7273af295">
|
---|
| 10 | <!ENTITY acpid-size "160 KB">
|
---|
[c176fc7] | 11 | <!ENTITY acpid-buildsize "1.9 MB">
|
---|
[f23c35f4] | 12 | <!ENTITY acpid-time "less than 0.1 SBU">
|
---|
[7efbf3d1] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="acpid" xreflabel="acpid-&acpid-version;">
|
---|
| 16 | <?dbhtml filename="acpid.html"?>
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | <title>acpid-&acpid-version;</title>
|
---|
| 20 |
|
---|
| 21 | <indexterm zone="acpid">
|
---|
| 22 | <primary sortas="a-acpid">acpid</primary>
|
---|
| 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="package">
|
---|
| 26 | <title>Introduction to acpid</title>
|
---|
| 27 |
|
---|
| 28 | <para>
|
---|
| 29 | The <application>acpid</application> (Advanced Configuration and Power
|
---|
| 30 | Interface event daemon) is a completely flexible, totally extensible
|
---|
| 31 | daemon for delivering ACPI events. It listens on netlink interface and
|
---|
| 32 | when an event occurs, executes programs to handle the event. The programs
|
---|
| 33 | it executes are configured through a set of configuration files, which can
|
---|
| 34 | be dropped into place by packages or by the user.
|
---|
| 35 | </para>
|
---|
| 36 |
|
---|
[1f9860d] | 37 | <note>
|
---|
| 38 | <para>
|
---|
| 39 | Some other packages may handle some ACPI events as well and they
|
---|
| 40 | may conflict with this package. For example, &logind;
|
---|
| 41 | (read the documentation for <option>Handle*=</option> in
|
---|
| 42 | <filename>logind.conf(5)</filename> for details) and
|
---|
| 43 | <xref linkend='upower'/> (used by many desktop environments such as
|
---|
| 44 | GNOME, KDE, and XFCE for handling ACPI events). If you've installed
|
---|
| 45 | such a package and it's enough for your use case, this package is
|
---|
| 46 | probably not needed. If you really need this package, you must be
|
---|
| 47 | careful configuring it and the other packages handling ACPI events
|
---|
| 48 | to avoid conflicts. Notably, &logind; handles some ACPI events
|
---|
| 49 | by default, so the handling of these events by &logind; should be
|
---|
| 50 | disabled first if handling these events with acpid
|
---|
| 51 | (again, read <filename>logind.conf(5)</filename> for details).
|
---|
| 52 | </para>
|
---|
| 53 | </note>
|
---|
| 54 |
|
---|
[c8b719a] | 55 | &lfs120_checked;
|
---|
[7efbf3d1] | 56 |
|
---|
| 57 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 58 | <itemizedlist spacing="compact">
|
---|
| 59 | <listitem>
|
---|
| 60 | <para>
|
---|
| 61 | Download (HTTP): <ulink url="&acpid-download-http;"/>
|
---|
| 62 | </para>
|
---|
| 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>
|
---|
| 66 | Download (FTP): <ulink url="&acpid-download-ftp;"/>
|
---|
| 67 | </para>
|
---|
| 68 | </listitem>
|
---|
| 69 | <listitem>
|
---|
| 70 | <para>
|
---|
| 71 | Download MD5 sum: &acpid-md5sum;
|
---|
| 72 | </para>
|
---|
| 73 | </listitem>
|
---|
| 74 | <listitem>
|
---|
| 75 | <para>
|
---|
| 76 | Download size: &acpid-size;
|
---|
| 77 | </para>
|
---|
| 78 | </listitem>
|
---|
| 79 | <listitem>
|
---|
| 80 | <para>
|
---|
| 81 | Estimated disk space required: &acpid-buildsize;
|
---|
| 82 | </para>
|
---|
| 83 | </listitem>
|
---|
| 84 | <listitem>
|
---|
| 85 | <para>
|
---|
| 86 | Estimated build time: &acpid-time;
|
---|
| 87 | </para>
|
---|
| 88 | </listitem>
|
---|
| 89 | </itemizedlist>
|
---|
| 90 |
|
---|
| 91 | </sect2>
|
---|
| 92 |
|
---|
| 93 | <sect2 role="installation">
|
---|
| 94 | <title>Installation of acpid</title>
|
---|
| 95 |
|
---|
| 96 | <para>
|
---|
| 97 | Install <application>acpid</application> by
|
---|
| 98 | running the following commands:
|
---|
| 99 | </para>
|
---|
| 100 |
|
---|
[68d5b0e] | 101 | <screen><userinput>./configure --prefix=/usr \
|
---|
| 102 | --docdir=/usr/share/doc/acpid-&acpid-version; &&
|
---|
[7efbf3d1] | 103 | make</userinput></screen>
|
---|
| 104 |
|
---|
| 105 | <para>
|
---|
| 106 | This package does not come with a test suite.
|
---|
| 107 | </para>
|
---|
| 108 |
|
---|
| 109 | <para>
|
---|
| 110 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 111 | </para>
|
---|
| 112 |
|
---|
[7fe07f59] | 113 | <screen role="root"><userinput>make install &&
|
---|
[7efbf3d1] | 114 | install -v -m755 -d /etc/acpi/events &&
|
---|
| 115 | cp -r samples /usr/share/doc/acpid-&acpid-version;</userinput></screen>
|
---|
| 116 |
|
---|
| 117 | </sect2>
|
---|
| 118 |
|
---|
| 119 | <sect2 role="configuration">
|
---|
| 120 | <title>Configuring acpid</title>
|
---|
| 121 |
|
---|
| 122 | <para>
|
---|
| 123 | <application>acpid</application> is configured by user defined events.
|
---|
| 124 | Place event files under
|
---|
| 125 | <filename class="directory">/etc/acpi/events</filename> directory. If an
|
---|
| 126 | event occurs, <command>acpid</command> recurses through the event files in
|
---|
| 127 | order to see if the regex defined after "event" matches. If they do,
|
---|
| 128 | action is executed.
|
---|
| 129 | </para>
|
---|
| 130 |
|
---|
| 131 | <para>
|
---|
[1f9860d] | 132 | The following brief example will suspend the system when the laptop
|
---|
| 133 | lid is closed<phrase revision='sysv'> (it requires
|
---|
| 134 | <xref linkend="pm-utils"/>)</phrase>. The example also disables
|
---|
| 135 | the default handling of the lid close event by &logind; when the
|
---|
| 136 | system is on battery and not connected to any external monitor,
|
---|
| 137 | in order to avoid a conflict:
|
---|
[7efbf3d1] | 138 | </para>
|
---|
| 139 |
|
---|
[1f9860d] | 140 | <screen revision='sysv' role="nodump"><userinput>cat > /etc/acpi/events/lid << "EOF"
|
---|
[7efbf3d1] | 141 | <literal>event=button/lid
|
---|
| 142 | action=/etc/acpi/lid.sh</literal>
|
---|
| 143 | EOF
|
---|
| 144 |
|
---|
| 145 | cat > /etc/acpi/lid.sh << "EOF"
|
---|
| 146 | <literal>#!/bin/sh
|
---|
| 147 | /bin/grep -q open /proc/acpi/button/lid/LID/state && exit 0
|
---|
| 148 | /usr/sbin/pm-suspend</literal>
|
---|
| 149 | EOF
|
---|
[1f9860d] | 150 | chmod +x /etc/acpi/lid.sh
|
---|
| 151 |
|
---|
| 152 | mkdir -pv /etc/elogind/logind.conf.d
|
---|
| 153 | echo <literal>HandleLidSwitch=ignore</literal> > /etc/elogind/logind.conf.d/acpi.conf</userinput></screen>
|
---|
| 154 |
|
---|
| 155 | <screen revision='systemd' role="nodump"><userinput>cat > /etc/acpi/events/lid << "EOF"
|
---|
| 156 | <literal>event=button/lid
|
---|
| 157 | action=/etc/acpi/lid.sh</literal>
|
---|
| 158 | EOF
|
---|
| 159 |
|
---|
| 160 | cat > /etc/acpi/lid.sh << "EOF"
|
---|
| 161 | <literal>#!/bin/sh
|
---|
| 162 | /bin/grep -q open /proc/acpi/button/lid/LID/state && exit 0
|
---|
| 163 | /usr/bin/systemctl suspend</literal>
|
---|
| 164 | EOF
|
---|
| 165 | chmod +x /etc/acpi/lid.sh
|
---|
| 166 |
|
---|
| 167 | mkdir -pv /etc/systemd/logind.conf.d
|
---|
| 168 | echo <literal>HandleLidSwitch=ignore</literal> > /etc/systemd/logind.conf.d/acpi.conf</userinput></screen>
|
---|
[7efbf3d1] | 169 |
|
---|
| 170 | <para>
|
---|
[1f9860d] | 171 | Unfortunately, not every computer labels ACPI events in the same way
|
---|
| 172 | (for example, the lid may be recognized as <filename>LID0</filename>
|
---|
| 173 | instead of <filename>LID</filename>).
|
---|
| 174 | To determine how your buttons are recognized, use the
|
---|
[af8a78d] | 175 | <command>acpi_listen</command> tool. Also, look in the <filename
|
---|
| 176 | class="directory">samples</filename> directory under <filename
|
---|
| 177 | class="directory">/usr/share/doc/acpid-&acpid-version;</filename>
|
---|
| 178 | for more examples.
|
---|
[7efbf3d1] | 179 | </para>
|
---|
| 180 |
|
---|
| 181 | <sect3 id="acpid-init">
|
---|
[d5497a2e] | 182 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
| 183 | <phrase revision="systemd">Systemd Socket</phrase></title>
|
---|
[7efbf3d1] | 184 |
|
---|
[d5497a2e] | 185 | <para revision="sysv">
|
---|
[7efbf3d1] | 186 | To automatically start <command>acpid</command> when the system is
|
---|
| 187 | rebooted, install the <filename>/etc/rc.d/init.d/acpid</filename>
|
---|
[d5497a2e] | 188 | boot script from the <xref linkend="bootscripts"/> package.
|
---|
| 189 | </para>
|
---|
| 190 |
|
---|
| 191 | <para revision="systemd">
|
---|
| 192 | To start the <command>acpid</command> daemon at boot,
|
---|
| 193 | install the systemd unit from the <xref linkend="systemd-units"/>
|
---|
| 194 | package by running the following command as the
|
---|
| 195 | <systemitem class="username">root</systemitem> user:
|
---|
[7efbf3d1] | 196 | </para>
|
---|
| 197 |
|
---|
| 198 | <indexterm zone="acpid acpid-init">
|
---|
| 199 | <primary sortas="f-acpid">acpid</primary>
|
---|
| 200 | </indexterm>
|
---|
| 201 |
|
---|
| 202 | <screen role="root"><userinput>make install-acpid</userinput></screen>
|
---|
| 203 |
|
---|
[d5497a2e] | 204 | <note revision="systemd">
|
---|
| 205 | <para>
|
---|
| 206 | This package uses socket based activation and will be started when
|
---|
| 207 | something needs it. No standalone unit file is provided for this
|
---|
| 208 | package.
|
---|
| 209 | </para>
|
---|
| 210 | </note>
|
---|
| 211 |
|
---|
[7efbf3d1] | 212 | </sect3>
|
---|
| 213 |
|
---|
| 214 | </sect2>
|
---|
| 215 |
|
---|
| 216 | <sect2 role="content">
|
---|
| 217 | <title>Contents</title>
|
---|
| 218 |
|
---|
| 219 | <segmentedlist>
|
---|
| 220 | <segtitle>Installed Programs</segtitle>
|
---|
| 221 | <segtitle>Installed Libraries</segtitle>
|
---|
[68d5b0e] | 222 | <segtitle>Installed Directories</segtitle>
|
---|
[7efbf3d1] | 223 |
|
---|
| 224 | <seglistitem>
|
---|
| 225 | <seg>
|
---|
[d3789ec7] | 226 | acpid, acpi_listen, and kacpimon
|
---|
[7efbf3d1] | 227 | </seg>
|
---|
| 228 | <seg>
|
---|
| 229 | None
|
---|
| 230 | </seg>
|
---|
| 231 | <seg>
|
---|
[68d5b0e] | 232 | /etc/acpi and /usr/share/doc/acpid-&acpid-version;
|
---|
[7efbf3d1] | 233 | </seg>
|
---|
| 234 | </seglistitem>
|
---|
| 235 | </segmentedlist>
|
---|
| 236 |
|
---|
| 237 | <variablelist>
|
---|
| 238 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 239 | <?dbfo list-presentation="list"?>
|
---|
| 240 | <?dbhtml list-presentation="table"?>
|
---|
| 241 |
|
---|
| 242 | <varlistentry id="acpid-prog">
|
---|
| 243 | <term><command>acpid</command></term>
|
---|
| 244 | <listitem>
|
---|
| 245 | <para>
|
---|
| 246 | is a program that listens for ACPI events and executes the rules
|
---|
[4c24eb0a] | 247 | that match the received event
|
---|
[7efbf3d1] | 248 | </para>
|
---|
| 249 | <indexterm zone="acpid acpid-prog">
|
---|
| 250 | <primary sortas="b-acpid">acpid</primary>
|
---|
| 251 | </indexterm>
|
---|
| 252 | </listitem>
|
---|
| 253 | </varlistentry>
|
---|
| 254 |
|
---|
| 255 | <varlistentry id="acpi_listen">
|
---|
| 256 | <term><command>acpi_listen</command></term>
|
---|
| 257 | <listitem>
|
---|
| 258 | <para>
|
---|
| 259 | is a simple tool which connects to <command>acpid</command> and
|
---|
[4c24eb0a] | 260 | listens for events
|
---|
[7efbf3d1] | 261 | </para>
|
---|
| 262 | <indexterm zone="acpid acpi_listen">
|
---|
| 263 | <primary sortas="b-acpi_listen">acpi_listen</primary>
|
---|
| 264 | </indexterm>
|
---|
| 265 | </listitem>
|
---|
| 266 | </varlistentry>
|
---|
| 267 |
|
---|
| 268 | <varlistentry id="kacpimon">
|
---|
| 269 | <term><command>kacpimon</command></term>
|
---|
| 270 | <listitem>
|
---|
| 271 | <para>
|
---|
| 272 | is a monitor program that connects to three sources of ACPI events
|
---|
| 273 | (events file, netlink and input layer) and then reports on what it
|
---|
[4c24eb0a] | 274 | sees while it is connected
|
---|
[7efbf3d1] | 275 | </para>
|
---|
| 276 | <indexterm zone="acpid kacpimon">
|
---|
| 277 | <primary sortas="b-kacpimon">kacpimon</primary>
|
---|
| 278 | </indexterm>
|
---|
| 279 | </listitem>
|
---|
| 280 | </varlistentry>
|
---|
| 281 |
|
---|
| 282 | </variablelist>
|
---|
| 283 |
|
---|
| 284 | </sect2>
|
---|
| 285 |
|
---|
| 286 | </sect1>
|
---|