source: general/sysutils/elogind.xml@ b1a8c0e8

12.0 12.1 gimp3 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/for-12.3 xry111/llvm18 xry111/spidermonkey128 xry111/xf86-video-removal
Last change on this file since b1a8c0e8 was eb9f0ef, checked in by Xi Ruoyao <xry111@…>, 14 months ago

elogind: Document two tests depending on /etc/machine-id

  • Property mode set to 100644
File size: 13.2 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 elogind-download-http "https://github.com/elogind/elogind/archive/v&elogind-version;/elogind-&elogind-version;.tar.gz">
8 <!ENTITY elogind-download-ftp " ">
9 <!ENTITY elogind-md5sum "2be2c43298e2fc41c5bee33dde605f01">
10 <!ENTITY elogind-size "1.8 MB">
11 <!ENTITY elogind-buildsize "45 MB (with tests)">
12 <!ENTITY elogind-time "0.3 SBU (with parallelism=4)">
13]>
14
15<sect1 id="elogind" revision="sysv" xreflabel="elogind-&elogind-version;">
16 <?dbhtml filename="elogind.html"?>
17
18
19 <title>elogind-&elogind-version;</title>
20
21 <indexterm zone="elogind">
22 <primary sortas="a-elogind">elogind</primary>
23 </indexterm>
24
25 <sect2 role="package">
26 <title>Introduction to elogind</title>
27
28 <para>
29 <application>elogind</application> is the
30 <application>systemd</application> project's "logind", extracted to
31 be a standalone daemon. It integrates with <xref linkend="linux-pam"/>
32 to track all the users logged in to a system, and whether they
33 are logged in graphically, on the console, or remotely.
34 <application>Elogind</application> exposes this information via the
35 standard org.freedesktop.login1 <application>D-Bus</application>
36 interface, and also through the file system using systemd's standard
37 <filename class="directory">/run/systemd</filename> layout.
38 </para>
39
40 &lfs113_checked;
41
42 <bridgehead renderas="sect3">Package Information</bridgehead>
43 <itemizedlist spacing="compact">
44 <listitem>
45 <para>
46 Download (HTTP): <ulink url="&elogind-download-http;"/>
47 </para>
48 </listitem>
49 <listitem>
50 <para>
51 Download (FTP): <ulink url="&elogind-download-ftp;"/>
52 </para>
53 </listitem>
54 <listitem>
55 <para>
56 Download MD5 sum: &elogind-md5sum;
57 </para>
58 </listitem>
59 <listitem>
60 <para>
61 Download size: &elogind-size;
62 </para>
63 </listitem>
64 <listitem>
65 <para>
66 Estimated disk space required: &elogind-buildsize;
67 </para>
68 </listitem>
69 <listitem>
70 <para>
71 Estimated build time: &elogind-time;
72 </para>
73 </listitem>
74 </itemizedlist>
75
76 <bridgehead renderas="sect3">elogind Dependencies</bridgehead>
77
78 <bridgehead renderas="sect4">Required</bridgehead>
79 <para role="required">
80 <xref linkend="Jinja2"/>
81 </para>
82
83 <bridgehead renderas="sect4">Recommended</bridgehead>
84 <para role="recommended">
85 <xref role="runtime" linkend="dbus"/> (runtime),
86 <xref linkend="linux-pam"/> (required for Xorg),
87 <xref role="runtime" linkend="polkit"/> (runtime),
88 <xref linkend="DocBook"/>,
89 <xref linkend="docbook-xsl"/>, and
90 <xref linkend="libxslt"/> (all three to build the man pages)
91 </para>
92
93 <bridgehead renderas="sect4">Optional</bridgehead>
94 <para role="optional">
95 <xref linkend="lxml"/>,
96 <xref linkend="zsh"/>,
97 <xref linkend="valgrind"/> (needed for tests),
98 <ulink url="https://github.com/linux-audit/audit-userspace">
99 audit-userspace</ulink>,
100 <ulink url="https://github.com/scop/bash-completion">
101 bash-completion</ulink>,
102 <ulink url="https://mirrors.edge.kernel.org/pub/linux/utils/kernel/kexec/">
103 kexec</ulink>, and
104 <ulink url="https://selinuxproject.org/page/Main_Page">
105 SELinux</ulink>
106 </para>
107
108 </sect2>
109
110 <sect2 role="kernel" id="elogind-kernel">
111 <title>Kernel Configuration</title>
112
113 <para>
114 Enable the following options in the kernel configuration and recompile the
115 kernel if necessary:
116 </para>
117
118<!-- Spaces are significant in <screen> sections -->
119<screen><literal>General setup ---&gt;
120 [*] Control Group support [CONFIG_CGROUPS]
121File systems ---&gt;
122 [*] Inotify support for userspace [CONFIG_INOTIFY_USER]
123 Pseudo filesystems ---&gt;
124 [*] Tmpfs POSIX Access Control Lists [CONFIG_TMPFS_POSIX_ACL]</literal></screen>
125
126 <para>
127 In addition, some tests need the userspace cryptographic kernel API, which
128 is enabled with:
129 </para>
130
131<screen><literal>-*- Cryptographic API ---&gt; [CONFIG_CRYPTO]
132 Crypto core or helper --->
133 &lt;M/*&gt; Userspace cryptographic algorithm configuration [CONFIG_CRYPTO_USER]
134 Userspace interface --->
135 &lt;M/*&gt; Hash algorithms [CONFIG_CRYPTO_USER_API_HASH]</literal></screen>
136
137 <indexterm zone="elogind elogind-kernel">
138 <primary sortas="d-elogind">elogind</primary>
139 </indexterm>
140 </sect2>
141
142 <sect2 role="installation">
143 <title>Installation of elogind</title>
144
145 <para>
146 Install <application>elogind</application> by running the following
147 commands:
148 </para>
149
150<screen><userinput><!--sed -i '/Disable polkit/,+8 d' meson.build &amp;&amp;
151
152sed '/request_name/i\
153r = sd_bus_set_exit_on_disconnect(m->bus, true);\
154if (r &lt; 0)\
155 return log_error_errno(r, "Failed to set exit on disconnect: %m");' \
156 -i src/login/logind.c &amp;&amp;
157
158-->mkdir build &amp;&amp;
159cd build &amp;&amp;
160
161meson setup .. \
162 --prefix=/usr \
163 --buildtype=release \
164 -Dman=auto \
165 -Ddocdir=/usr/share/doc/elogind-&elogind-version; \
166 -Dcgroup-controller=elogind \
167 -Ddbuspolicydir=/etc/dbus-1/system.d &amp;&amp;
168ninja</userinput></screen>
169
170 <para>
171 To test the results, issue: <command>ninja test</command>. A few tests
172 are skipped if not run with <systemitem class="username">root</systemitem>
173 privileges. Two tests named <filename>test-fs-util</filename> and
174 <filename>test-id128</filename> require the
175 <filename>/etc/machine-id</filename> symlink, so they will fail if
176 this symlink is not created following the instruction in
177 <xref linkend='dbus'/> yet.
178 </para>
179
180 <para>
181 Now, as the <systemitem class="username">root</systemitem> user:
182 </para>
183
184<screen role="root"><userinput>ninja install &amp;&amp;
185ln -sfv libelogind.pc /usr/lib/pkgconfig/libsystemd.pc &amp;&amp;
186ln -sfvn elogind /usr/include/systemd</userinput></screen>
187
188 </sect2>
189
190 <sect2 role="commands">
191 <title>Command Explanations</title>
192 <!--
193 <para>
194 <command>sed ... meson.build</command>: This change allows the
195 package to be built without polkit being installed (it is still a
196 runtime dependency) but able to use polkit after that package is
197 installed.
198 </para>
199
200 <para>
201 <command>sed ... src/login/logind.c</command>: This change allows the
202 elogind daemon to exit when it is disconnected from dbus (for example
203 when dbus is killed).
204 </para>
205 -->
206 <para>
207 <parameter>-Ddocdir=/usr/share/doc/elogind-&elogind-version;</parameter>:
208 This is needed to install documentation in a versioned directory.
209 </para>
210
211 <para>
212 <parameter>-Dcgroup-controller=elogind</parameter>: This switch ensures
213 that <application>elogind</application> is selected as the cgroup
214 controller, even if booted with another running cgroup controller.
215 </para>
216
217 <para>
218 <parameter>-Ddbuspolicydir=/etc/dbus-1/system.d</parameter>: This switch
219 sets the location of the <application>D-Bus</application> policy
220 directory.
221 </para>
222
223 <para>
224 <parameter>-Dman=auto</parameter>: The default value of this switch is
225 <emphasis>false</emphasis>. Setting it to <emphasis>auto</emphasis>
226 allows building and installing the man pages if the recommended
227 dependencies are installed.
228 </para>
229
230 <para>
231 <option>-Dhtml=auto</option>: The default value of this switch is
232 <emphasis>false</emphasis>. Setting it to <emphasis>auto</emphasis>
233 allows building and installing the html documentation if the recommended
234 dependencies are installed.
235 </para>
236
237 <para>
238 <option>-Ddefault-kill-user-processes=false</option>: Determines whether
239 the processes of a user should be killed when the user logs out. The
240 default is <emphasis>true</emphasis>, but this defeats the traditional
241 use of <command>screen</command> or <command>tmux</command>. This can
242 also be changed in the configuration file (see below).
243 </para>
244
245 <para>
246 <command>ln -s ...</command>: These commands install symlinks so that
247 software packages can find the systemd-compatible library and headers.
248 </para>
249
250 </sect2>
251
252 <sect2 role="configuration">
253 <title>Configuring elogind</title>
254
255 <sect3 id="elogind-config">
256 <title>Config File</title>
257 <para>
258 <filename>/etc/elogind/logind.conf</filename>
259 </para>
260
261 <indexterm zone="elogind elogind-config">
262 <primary
263 sortas="e-etc-elogind-logind.conf">/etc/elogind/logind.conf</primary>
264 </indexterm>
265 </sect3>
266
267 <sect3><title>Configuration Information</title>
268
269 <para>
270 The installed file <filename>/etc/elogind/logind.conf</filename>
271 contains all the possible options with their defaults, commented
272 out. You may wish to disable automatically killing user processes when the user logs
273 out, by running, as the <systemitem class="username">root</systemitem>
274 user:
275 </para>
276
277<screen role="root"><userinput>sed -e '/\[Login\]/a KillUserProcesses=no' \
278 -i /etc/elogind/logind.conf</userinput></screen>
279
280 <para>
281 Each user will need to register a user session using
282 <application>Linux-PAM</application> at login. The
283 <filename>/etc/pam.d/system-session</filename> file needs to
284 be modified and a new file must be created in order for
285 <command>elogind</command> to work correctly. Run the following
286 commands as the <systemitem class="username">root</systemitem> user:
287 </para>
288
289<screen role="root"><userinput>cat &gt;&gt; /etc/pam.d/system-session &lt;&lt; "EOF" &amp;&amp;
290<literal># Begin elogind addition
291
292session required pam_loginuid.so
293session optional pam_elogind.so
294
295# End elogind addition</literal>
296EOF
297cat &gt; /etc/pam.d/elogind-user &lt;&lt; "EOF"
298<literal># Begin /etc/pam.d/elogind-user
299
300account required pam_access.so
301account include system-account
302
303session required pam_env.so
304session required pam_limits.so
305session required pam_unix.so
306session required pam_loginuid.so
307session optional pam_keyinit.so force revoke
308session optional pam_elogind.so
309
310auth required pam_deny.so
311password required pam_deny.so
312
313# End /etc/pam.d/elogind-user</literal>
314EOF</userinput></screen>
315
316 </sect3>
317 </sect2>
318
319 <sect2 role="content" revision="sysv">
320 <title>Contents</title>
321
322 <segmentedlist>
323 <segtitle>Installed Programs</segtitle>
324 <segtitle>Installed Library</segtitle>
325 <segtitle>Installed Directories</segtitle>
326
327 <seglistitem>
328 <seg>
329 busctl,
330 elogind-inhibit, and
331 loginctl
332 </seg>
333 <seg>
334 libelogind.so
335 </seg>
336 <seg>
337 /usr/lib/elogind,
338 /etc/elogind,
339 /usr/include/elogind, and
340 /usr/share/doc/elogind-&elogind-version;
341 </seg>
342 </seglistitem>
343 </segmentedlist>
344
345 <variablelist>
346 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
347 <?dbfo list-presentation="list"?>
348 <?dbhtml list-presentation="table"?>
349
350 <varlistentry id="busctl">
351 <term><command>busctl</command></term>
352 <listitem>
353 <para>
354 is used to introspect and monitor the D-Bus bus
355 </para>
356 <indexterm zone="elogind busctl">
357 <primary sortas="b-busctl">busctl</primary>
358 </indexterm>
359 </listitem>
360 </varlistentry>
361
362 <varlistentry id="elogind-inhibit">
363 <term><command>elogind-inhibit</command></term>
364 <listitem>
365 <para>
366 is used to execute a program with a shutdown, sleep or idle
367 inhibitor lock taken
368 </para>
369 <indexterm zone="elogind elogind-inhibit">
370 <primary sortas="b-elogind-inhibit">elogind-inhibit</primary>
371 </indexterm>
372 </listitem>
373 </varlistentry>
374
375 <varlistentry id="loginctl">
376 <term><command>loginctl</command></term>
377 <listitem>
378 <para>
379 is used to introspect and control the state of the elogind Login
380 Manager
381 </para>
382 <indexterm zone="elogind loginctl">
383 <primary sortas="b-loginctl">loginctl</primary>
384 </indexterm>
385 </listitem>
386 </varlistentry>
387
388 <varlistentry id="libelogind">
389 <term><filename class="libraryfile">libelogind.so</filename></term>
390 <listitem>
391 <para>
392 is the main elogind utility library
393 </para>
394 <indexterm zone="elogind libelogind">
395 <primary sortas="c-libelogind">libelogind.so</primary>
396 </indexterm>
397 </listitem>
398 </varlistentry>
399
400 </variablelist>
401
402 </sect2>
403
404</sect1>
Note: See TracBrowser for help on using the repository browser.