source: general/sysutils/elogind.xml@ b1a8c0e8

12.0 12.1 12.2 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
RevLine 
[ff3264f]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 " ">
[1db852a]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)">
[ff3264f]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
[76a6005]30 <application>systemd</application> project's "logind", extracted to
[ff3264f]31 be a standalone daemon. It integrates with <xref linkend="linux-pam"/>
[76a6005]32 to track all the users logged in to a system, and whether they
[ff3264f]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>
[76a6005]36 interface, and also through the file system using systemd's standard
[ff3264f]37 <filename class="directory">/run/systemd</filename> layout.
38 </para>
39
[dc1a45e]40 &lfs113_checked;
[ff3264f]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
[702c50c]78 <bridgehead renderas="sect4">Required</bridgehead>
79 <para role="required">
80 <xref linkend="Jinja2"/>
81 </para>
82
[ff3264f]83 <bridgehead renderas="sect4">Recommended</bridgehead>
84 <para role="recommended">
[992c9e7]85 <xref role="runtime" linkend="dbus"/> (runtime),
[779b3223]86 <xref linkend="linux-pam"/> (required for Xorg),
[992c9e7]87 <xref role="runtime" linkend="polkit"/> (runtime),
[ff3264f]88 <xref linkend="DocBook"/>,
89 <xref linkend="docbook-xsl"/>, and
[8558044]90 <xref linkend="libxslt"/> (all three to build the man pages)
[ff3264f]91 </para>
92
93 <bridgehead renderas="sect4">Optional</bridgehead>
94 <para role="optional">
95 <xref linkend="lxml"/>,
96 <xref linkend="zsh"/>,
[992c9e7]97 <xref linkend="valgrind"/> (needed for tests),
[ff3264f]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
[6e2eb5cf]104 <ulink url="https://selinuxproject.org/page/Main_Page">
[ff3264f]105 SELinux</ulink>
106 </para>
107
108 </sect2>
109
[398b4239]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;
[6735113]122 [*] Inotify support for userspace [CONFIG_INOTIFY_USER]
123 Pseudo filesystems ---&gt;
124 [*] Tmpfs POSIX Access Control Lists [CONFIG_TMPFS_POSIX_ACL]</literal></screen>
[398b4239]125
[cce4984]126 <para>
127 In addition, some tests need the userspace cryptographic kernel API, which
128 is enabled with:
129 </para>
130
[c667e1e]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>
[cce4984]136
[398b4239]137 <indexterm zone="elogind elogind-kernel">
138 <primary sortas="d-elogind">elogind</primary>
139 </indexterm>
140 </sect2>
141
[ff3264f]142 <sect2 role="installation">
143 <title>Installation of elogind</title>
[7a1065c]144
[ff3264f]145 <para>
146 Install <application>elogind</application> by running the following
147 commands:
148 </para>
149
[1db852a]150<screen><userinput><!--sed -i '/Disable polkit/,+8 d' meson.build &amp;&amp;
[65d85668]151
[27e5cd4c]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
[1db852a]158-->mkdir build &amp;&amp;
[488cea3]159cd build &amp;&amp;
[ff3264f]160
[1db852a]161meson setup .. \
162 --prefix=/usr \
163 --buildtype=release \
164 -Dman=auto \
165 -Ddocdir=/usr/share/doc/elogind-&elogind-version; \
166 -Dcgroup-controller=elogind \
[91318eb]167 -Ddbuspolicydir=/etc/dbus-1/system.d &amp;&amp;
[ff3264f]168ninja</userinput></screen>
169
170 <para>
[cce4984]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>
[eb9f0ef]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.
[ff3264f]178 </para>
179
180 <para>
181 Now, as the <systemitem class="username">root</systemitem> user:
182 </para>
183
[1ede364c]184<screen role="root"><userinput>ninja install &amp;&amp;
[ff3264f]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>
[1db852a]192 <!--
[65d85668]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
[8558044]196 runtime dependency) but able to use polkit after that package is
[65d85668]197 installed.
198 </para>
199
[27e5cd4c]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>
[1db852a]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>
[27e5cd4c]210
[ff3264f]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>
[adb90981]222
[cce4984]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.
[adb90981]228 </para>
[ff3264f]229
[1db852a]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
[6545b53f]237 <para>
[76a6005]238 <option>-Ddefault-kill-user-processes=false</option>: Determines whether
[6545b53f]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
[ff3264f]245 <para>
246 <command>ln -s ...</command>: These commands install symlinks so that
[76a6005]247 software packages can find the systemd-compatible library and headers.
[ff3264f]248 </para>
249
250 </sect2>
251
252 <sect2 role="configuration">
253 <title>Configuring elogind</title>
254
[6545b53f]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
[76a6005]272 out. You may wish to disable automatically killing user processes when the user logs
[6545b53f]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
[76a6005]284 be modified and a new file must be created in order for
[6545b53f]285 <command>elogind</command> to work correctly. Run the following
286 commands as the <systemitem class="username">root</systemitem> user:
287 </para>
[ff3264f]288
289<screen role="root"><userinput>cat &gt;&gt; /etc/pam.d/system-session &lt;&lt; "EOF" &amp;&amp;
290<literal># Begin elogind addition
[8558044]291
[ff3264f]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
[6545b53f]316 </sect3>
[ff3264f]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>
[1db852a]337 /usr/lib/elogind,
[ff3264f]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>
[4c24eb0a]354 is used to introspect and monitor the D-Bus bus
[ff3264f]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
[4c24eb0a]367 inhibitor lock taken
[ff3264f]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
[4c24eb0a]380 Manager
[ff3264f]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>
[4c24eb0a]392 is the main elogind utility library
[ff3264f]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
[4c24eb0a]404</sect1>
Note: See TracBrowser for help on using the repository browser.