source: general/sysutils/acpid.xml@ 1f9860d

12.0 12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since 1f9860d was 1f9860d, checked in by Xi Ruoyao <xry111@…>, 9 months ago

acpid: Add info to avoid conflict with other ACPI event handlers, and...

use "systemctl suspend" instead of pm-suspend on systemd.

  • Property mode set to 100644
File size: 9.3 KB
Line 
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
7 <!ENTITY acpid-download-http "&sourceforge-dl;/acpid2/acpid-&acpid-version;.tar.xz">
8 <!ENTITY acpid-download-ftp " ">
9 <!ENTITY acpid-md5sum "988c2e3fd5ba0ea4492d3ba7273af295">
10 <!ENTITY acpid-size "160 KB">
11 <!ENTITY acpid-buildsize "1.9 MB">
12 <!ENTITY acpid-time "less than 0.1 SBU">
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
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
55 &lfs120_checked;
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
101<screen><userinput>./configure --prefix=/usr \
102 --docdir=/usr/share/doc/acpid-&acpid-version; &amp;&amp;
103make</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
113<screen role="root"><userinput>make install &amp;&amp;
114install -v -m755 -d /etc/acpi/events &amp;&amp;
115cp -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>
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:
138 </para>
139
140<screen revision='sysv' role="nodump"><userinput>cat &gt; /etc/acpi/events/lid &lt;&lt; "EOF"
141<literal>event=button/lid
142action=/etc/acpi/lid.sh</literal>
143EOF
144
145cat &gt; /etc/acpi/lid.sh &lt;&lt; "EOF"
146<literal>#!/bin/sh
147/bin/grep -q open /proc/acpi/button/lid/LID/state &amp;&amp; exit 0
148/usr/sbin/pm-suspend</literal>
149EOF
150chmod +x /etc/acpi/lid.sh
151
152mkdir -pv /etc/elogind/logind.conf.d
153echo <literal>HandleLidSwitch=ignore</literal> &gt; /etc/elogind/logind.conf.d/acpi.conf</userinput></screen>
154
155<screen revision='systemd' role="nodump"><userinput>cat &gt; /etc/acpi/events/lid &lt;&lt; "EOF"
156<literal>event=button/lid
157action=/etc/acpi/lid.sh</literal>
158EOF
159
160cat &gt; /etc/acpi/lid.sh &lt;&lt; "EOF"
161<literal>#!/bin/sh
162/bin/grep -q open /proc/acpi/button/lid/LID/state &amp;&amp; exit 0
163/usr/bin/systemctl suspend</literal>
164EOF
165chmod +x /etc/acpi/lid.sh
166
167mkdir -pv /etc/systemd/logind.conf.d
168echo <literal>HandleLidSwitch=ignore</literal> &gt; /etc/systemd/logind.conf.d/acpi.conf</userinput></screen>
169
170 <para>
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
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.
179 </para>
180
181 <sect3 id="acpid-init">
182 <title><phrase revision="sysv">Boot Script</phrase>
183 <phrase revision="systemd">Systemd Socket</phrase></title>
184
185 <para revision="sysv">
186 To automatically start <command>acpid</command> when the system is
187 rebooted, install the <filename>/etc/rc.d/init.d/acpid</filename>
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:
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
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
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>
222 <segtitle>Installed Directories</segtitle>
223
224 <seglistitem>
225 <seg>
226 acpid, acpi_listen, and kacpimon
227 </seg>
228 <seg>
229 None
230 </seg>
231 <seg>
232 /etc/acpi and /usr/share/doc/acpid-&acpid-version;
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
247 that match the received event
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
260 listens for events
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
274 sees while it is connected
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>
Note: See TracBrowser for help on using the repository browser.