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