[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[ff3264f] | 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 " ">
|
---|
[3ae3465] | 9 | <!ENTITY elogind-md5sum "8653d1959c25b649c398a932ce56b396">
|
---|
[af2f8c8] | 10 | <!ENTITY elogind-size "2.0 MB">
|
---|
| 11 | <!ENTITY elogind-buildsize "48 MB (with tests)">
|
---|
[d05c484] | 12 | <!ENTITY elogind-time "0.4 SBU (with parallelism=4; with tests)">
|
---|
[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 |
|
---|
[d4dc5bae] | 40 | &lfs122_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 |
|
---|
| 78 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 79 | <para role="recommended">
|
---|
[992c9e7] | 80 | <xref role="runtime" linkend="dbus"/> (runtime),
|
---|
[779b3223] | 81 | <xref linkend="linux-pam"/> (required for Xorg),
|
---|
[992c9e7] | 82 | <xref role="runtime" linkend="polkit"/> (runtime),
|
---|
[ff3264f] | 83 | <xref linkend="DocBook"/>,
|
---|
| 84 | <xref linkend="docbook-xsl"/>, and
|
---|
[8558044] | 85 | <xref linkend="libxslt"/> (all three to build the man pages)
|
---|
[ff3264f] | 86 | </para>
|
---|
| 87 |
|
---|
| 88 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 89 | <para role="optional">
|
---|
| 90 | <xref linkend="lxml"/>,
|
---|
| 91 | <xref linkend="zsh"/>,
|
---|
[992c9e7] | 92 | <xref linkend="valgrind"/> (needed for tests),
|
---|
[ff3264f] | 93 | <ulink url="https://github.com/linux-audit/audit-userspace">
|
---|
| 94 | audit-userspace</ulink>,
|
---|
| 95 | <ulink url="https://github.com/scop/bash-completion">
|
---|
| 96 | bash-completion</ulink>,
|
---|
| 97 | <ulink url="https://mirrors.edge.kernel.org/pub/linux/utils/kernel/kexec/">
|
---|
| 98 | kexec</ulink>, and
|
---|
[6e2eb5cf] | 99 | <ulink url="https://selinuxproject.org/page/Main_Page">
|
---|
[ff3264f] | 100 | SELinux</ulink>
|
---|
| 101 | </para>
|
---|
| 102 |
|
---|
[2f19398] | 103 | <para condition="html" role="usernotes">
|
---|
| 104 | Editor Notes: <ulink url="&blfs-wiki;/Logind"/>
|
---|
| 105 | </para>
|
---|
| 106 |
|
---|
[ff3264f] | 107 | </sect2>
|
---|
| 108 |
|
---|
[398b4239] | 109 | <sect2 role="kernel" id="elogind-kernel">
|
---|
| 110 | <title>Kernel Configuration</title>
|
---|
| 111 |
|
---|
| 112 | <para>
|
---|
| 113 | Enable the following options in the kernel configuration and recompile the
|
---|
| 114 | kernel if necessary:
|
---|
| 115 | </para>
|
---|
| 116 |
|
---|
[e7cd19a] | 117 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 118 | href="elogind-kernel.xml"/>
|
---|
[398b4239] | 119 |
|
---|
[cce4984] | 120 | <para>
|
---|
| 121 | In addition, some tests need the userspace cryptographic kernel API, which
|
---|
| 122 | is enabled with:
|
---|
| 123 | </para>
|
---|
| 124 |
|
---|
[e7cd19a] | 125 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 126 | href="elogind-test-kernel.xml"/>
|
---|
[cce4984] | 127 |
|
---|
[398b4239] | 128 | <indexterm zone="elogind elogind-kernel">
|
---|
| 129 | <primary sortas="d-elogind">elogind</primary>
|
---|
| 130 | </indexterm>
|
---|
| 131 | </sect2>
|
---|
| 132 |
|
---|
[ff3264f] | 133 | <sect2 role="installation">
|
---|
| 134 | <title>Installation of elogind</title>
|
---|
[7a1065c] | 135 |
|
---|
[ff3264f] | 136 | <para>
|
---|
| 137 | Install <application>elogind</application> by running the following
|
---|
| 138 | commands:
|
---|
| 139 | </para>
|
---|
| 140 |
|
---|
[88f6e30] | 141 | <screen><userinput>mkdir build &&
|
---|
[488cea3] | 142 | cd build &&
|
---|
[ff3264f] | 143 |
|
---|
[7c83169b] | 144 | meson setup .. \
|
---|
| 145 | --prefix=/usr \
|
---|
| 146 | --buildtype=release \
|
---|
| 147 | -D man=auto \
|
---|
| 148 | -D docdir=/usr/share/doc/elogind-&elogind-version; \
|
---|
| 149 | -D cgroup-controller=elogind \
|
---|
| 150 | -D dev-kvm-mode=0660 \
|
---|
| 151 | -D dbuspolicydir=/etc/dbus-1/system.d &&
|
---|
[ff3264f] | 152 | ninja</userinput></screen>
|
---|
| 153 |
|
---|
| 154 | <para>
|
---|
[cce4984] | 155 | To test the results, issue: <command>ninja test</command>. A few tests
|
---|
[88f6e30] | 156 | are skipped if not run with &root; privileges.
|
---|
[af2f8c8] | 157 | Three tests, <filename>test-login</filename>, <filename>dbus-docs-fresh</filename>,
|
---|
| 158 | and <filename>check-version-history</filename>, are known to fail.
|
---|
[88f6e30] | 159 | <!--
|
---|
[eb9f0ef] | 160 | <filename>test-id128</filename> require the
|
---|
| 161 | <filename>/etc/machine-id</filename> symlink, so they will fail if
|
---|
| 162 | this symlink is not created following the instruction in
|
---|
| 163 | <xref linkend='dbus'/> yet.
|
---|
[88f6e30] | 164 |
|
---|
| 165 | I did have the symlink and test-fs-util still failed (the only
|
---|
| 166 | one). The error was
|
---|
| 167 | Assertion 'chase_symlinks(q, NULL, CHASE_SAFE, NULL, NULL) >= 0'
|
---|
| 168 | failed at src/test/test-fs-util.c:303, function
|
---|
| 169 | test_chase_symlinks(). Aborting.
|
---|
| 170 | Looking at teh code, I don't think that is related to the
|
---|
| 171 | /etc/machine-id symlink. - bdubbs, version 252.23
|
---|
| 172 | -->
|
---|
[ff3264f] | 173 | </para>
|
---|
| 174 |
|
---|
| 175 | <para>
|
---|
| 176 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 177 | </para>
|
---|
| 178 |
|
---|
[1ede364c] | 179 | <screen role="root"><userinput>ninja install &&
|
---|
[ff3264f] | 180 | ln -sfv libelogind.pc /usr/lib/pkgconfig/libsystemd.pc &&
|
---|
| 181 | ln -sfvn elogind /usr/include/systemd</userinput></screen>
|
---|
| 182 |
|
---|
| 183 | </sect2>
|
---|
| 184 |
|
---|
| 185 | <sect2 role="commands">
|
---|
| 186 | <title>Command Explanations</title>
|
---|
[1db852a] | 187 | <!--
|
---|
[65d85668] | 188 | <para>
|
---|
| 189 | <command>sed ... meson.build</command>: This change allows the
|
---|
| 190 | package to be built without polkit being installed (it is still a
|
---|
[8558044] | 191 | runtime dependency) but able to use polkit after that package is
|
---|
[65d85668] | 192 | installed.
|
---|
| 193 | </para>
|
---|
| 194 |
|
---|
[27e5cd4c] | 195 | <para>
|
---|
| 196 | <command>sed ... src/login/logind.c</command>: This change allows the
|
---|
| 197 | elogind daemon to exit when it is disconnected from dbus (for example
|
---|
| 198 | when dbus is killed).
|
---|
| 199 | </para>
|
---|
[1db852a] | 200 | -->
|
---|
| 201 | <para>
|
---|
[7c83169b] | 202 | <parameter>-D docdir=/usr/share/doc/elogind-&elogind-version;</parameter>:
|
---|
[1db852a] | 203 | This is needed to install documentation in a versioned directory.
|
---|
| 204 | </para>
|
---|
[27e5cd4c] | 205 |
|
---|
[ff3264f] | 206 | <para>
|
---|
[7c83169b] | 207 | <parameter>-D cgroup-controller=elogind</parameter>: This switch is
|
---|
[b980f67] | 208 | necessary to build this package when the kernel is not built with
|
---|
| 209 | <option>CONFIG_CGROUPS</option> enabled. Note that
|
---|
| 210 | <application>elogind</application> strictly needs
|
---|
| 211 | a kernel with <option>CONFIG_CGROUPS</option> enabled at runtime,
|
---|
| 212 | but this switch will allow building the package first.
|
---|
[ff3264f] | 213 | </para>
|
---|
| 214 |
|
---|
| 215 | <para>
|
---|
[7c83169b] | 216 | <parameter>-D dbuspolicydir=/etc/dbus-1/system.d</parameter>: This switch
|
---|
[ff3264f] | 217 | sets the location of the <application>D-Bus</application> policy
|
---|
| 218 | directory.
|
---|
| 219 | </para>
|
---|
[adb90981] | 220 |
|
---|
[1a743079] | 221 | <para>
|
---|
[7c83169b] | 222 | <parameter>-D dev-kvm-mode=0660</parameter>: The LFS udev rule sets the
|
---|
[778470d] | 223 | mode of <filename class='devicefile'>/dev/kvm</filename> to 0660.
|
---|
| 224 | This option ensures the elogind udev rules consistent with the LFS
|
---|
| 225 | configuration.
|
---|
[1a743079] | 226 | </para>
|
---|
| 227 |
|
---|
[cce4984] | 228 | <para>
|
---|
[7c83169b] | 229 | <parameter>-D man=auto</parameter>: The default value of this switch is
|
---|
[cce4984] | 230 | <emphasis>false</emphasis>. Setting it to <emphasis>auto</emphasis>
|
---|
| 231 | allows building and installing the man pages if the recommended
|
---|
| 232 | dependencies are installed.
|
---|
[adb90981] | 233 | </para>
|
---|
[ff3264f] | 234 |
|
---|
[1db852a] | 235 | <para>
|
---|
[7c83169b] | 236 | <option>-D html=auto</option>: The default value of this switch is
|
---|
[1db852a] | 237 | <emphasis>false</emphasis>. Setting it to <emphasis>auto</emphasis>
|
---|
| 238 | allows building and installing the html documentation if the recommended
|
---|
| 239 | dependencies are installed.
|
---|
| 240 | </para>
|
---|
| 241 |
|
---|
[6545b53f] | 242 | <para>
|
---|
[7c83169b] | 243 | <option>-D default-kill-user-processes=false</option>: Determines whether
|
---|
[6545b53f] | 244 | the processes of a user should be killed when the user logs out. The
|
---|
| 245 | default is <emphasis>true</emphasis>, but this defeats the traditional
|
---|
| 246 | use of <command>screen</command> or <command>tmux</command>. This can
|
---|
| 247 | also be changed in the configuration file (see below).
|
---|
| 248 | </para>
|
---|
| 249 |
|
---|
[ff3264f] | 250 | <para>
|
---|
| 251 | <command>ln -s ...</command>: These commands install symlinks so that
|
---|
[76a6005] | 252 | software packages can find the systemd-compatible library and headers.
|
---|
[ff3264f] | 253 | </para>
|
---|
| 254 |
|
---|
| 255 | </sect2>
|
---|
| 256 |
|
---|
| 257 | <sect2 role="configuration">
|
---|
| 258 | <title>Configuring elogind</title>
|
---|
| 259 |
|
---|
[6545b53f] | 260 | <sect3 id="elogind-config">
|
---|
| 261 | <title>Config File</title>
|
---|
| 262 | <para>
|
---|
| 263 | <filename>/etc/elogind/logind.conf</filename>
|
---|
| 264 | </para>
|
---|
| 265 |
|
---|
| 266 | <indexterm zone="elogind elogind-config">
|
---|
| 267 | <primary
|
---|
| 268 | sortas="e-etc-elogind-logind.conf">/etc/elogind/logind.conf</primary>
|
---|
| 269 | </indexterm>
|
---|
| 270 | </sect3>
|
---|
| 271 |
|
---|
| 272 | <sect3><title>Configuration Information</title>
|
---|
| 273 |
|
---|
| 274 | <para>
|
---|
| 275 | The installed file <filename>/etc/elogind/logind.conf</filename>
|
---|
| 276 | contains all the possible options with their defaults, commented
|
---|
[76a6005] | 277 | out. You may wish to disable automatically killing user processes when the user logs
|
---|
[6545b53f] | 278 | out, by running, as the <systemitem class="username">root</systemitem>
|
---|
| 279 | user:
|
---|
| 280 | </para>
|
---|
| 281 |
|
---|
| 282 | <screen role="root"><userinput>sed -e '/\[Login\]/a KillUserProcesses=no' \
|
---|
| 283 | -i /etc/elogind/logind.conf</userinput></screen>
|
---|
| 284 |
|
---|
| 285 | <para>
|
---|
| 286 | Each user will need to register a user session using
|
---|
| 287 | <application>Linux-PAM</application> at login. The
|
---|
| 288 | <filename>/etc/pam.d/system-session</filename> file needs to
|
---|
[76a6005] | 289 | be modified and a new file must be created in order for
|
---|
[6545b53f] | 290 | <command>elogind</command> to work correctly. Run the following
|
---|
| 291 | commands as the <systemitem class="username">root</systemitem> user:
|
---|
| 292 | </para>
|
---|
[ff3264f] | 293 |
|
---|
| 294 | <screen role="root"><userinput>cat >> /etc/pam.d/system-session << "EOF" &&
|
---|
| 295 | <literal># Begin elogind addition
|
---|
[8558044] | 296 |
|
---|
[ff3264f] | 297 | session required pam_loginuid.so
|
---|
| 298 | session optional pam_elogind.so
|
---|
| 299 |
|
---|
| 300 | # End elogind addition</literal>
|
---|
| 301 | EOF
|
---|
| 302 | cat > /etc/pam.d/elogind-user << "EOF"
|
---|
| 303 | <literal># Begin /etc/pam.d/elogind-user
|
---|
| 304 |
|
---|
| 305 | account required pam_access.so
|
---|
| 306 | account include system-account
|
---|
| 307 |
|
---|
| 308 | session required pam_env.so
|
---|
| 309 | session required pam_limits.so
|
---|
| 310 | session required pam_unix.so
|
---|
| 311 | session required pam_loginuid.so
|
---|
| 312 | session optional pam_keyinit.so force revoke
|
---|
| 313 | session optional pam_elogind.so
|
---|
| 314 |
|
---|
| 315 | auth required pam_deny.so
|
---|
| 316 | password required pam_deny.so
|
---|
| 317 |
|
---|
| 318 | # End /etc/pam.d/elogind-user</literal>
|
---|
| 319 | EOF</userinput></screen>
|
---|
| 320 |
|
---|
[9535ecf8] | 321 | <note>
|
---|
[4b853a96] | 322 | <para>After completion of <application>elogind</application>,
|
---|
[9535ecf8] | 323 | you should check that it functions properly. First ensure that
|
---|
| 324 | <application>dbus</application> is running. It may be easiest
|
---|
| 325 | to do this by rebooting the system. After logging in again, run
|
---|
| 326 | the command <command>loginctl</command>. The result should indicate
|
---|
| 327 | that a SESSION and a SEAT have been created.</para>
|
---|
| 328 | </note>
|
---|
| 329 |
|
---|
[6545b53f] | 330 | </sect3>
|
---|
[ff3264f] | 331 | </sect2>
|
---|
| 332 |
|
---|
| 333 | <sect2 role="content" revision="sysv">
|
---|
| 334 | <title>Contents</title>
|
---|
| 335 |
|
---|
| 336 | <segmentedlist>
|
---|
| 337 | <segtitle>Installed Programs</segtitle>
|
---|
| 338 | <segtitle>Installed Library</segtitle>
|
---|
| 339 | <segtitle>Installed Directories</segtitle>
|
---|
| 340 |
|
---|
| 341 | <seglistitem>
|
---|
| 342 | <seg>
|
---|
| 343 | busctl,
|
---|
| 344 | elogind-inhibit, and
|
---|
| 345 | loginctl
|
---|
| 346 | </seg>
|
---|
| 347 | <seg>
|
---|
| 348 | libelogind.so
|
---|
| 349 | </seg>
|
---|
| 350 | <seg>
|
---|
[1db852a] | 351 | /usr/lib/elogind,
|
---|
[ff3264f] | 352 | /etc/elogind,
|
---|
| 353 | /usr/include/elogind, and
|
---|
| 354 | /usr/share/doc/elogind-&elogind-version;
|
---|
| 355 | </seg>
|
---|
| 356 | </seglistitem>
|
---|
| 357 | </segmentedlist>
|
---|
| 358 |
|
---|
| 359 | <variablelist>
|
---|
| 360 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 361 | <?dbfo list-presentation="list"?>
|
---|
| 362 | <?dbhtml list-presentation="table"?>
|
---|
| 363 |
|
---|
| 364 | <varlistentry id="busctl">
|
---|
| 365 | <term><command>busctl</command></term>
|
---|
| 366 | <listitem>
|
---|
| 367 | <para>
|
---|
[4c24eb0a] | 368 | is used to introspect and monitor the D-Bus bus
|
---|
[ff3264f] | 369 | </para>
|
---|
| 370 | <indexterm zone="elogind busctl">
|
---|
| 371 | <primary sortas="b-busctl">busctl</primary>
|
---|
| 372 | </indexterm>
|
---|
| 373 | </listitem>
|
---|
| 374 | </varlistentry>
|
---|
| 375 |
|
---|
| 376 | <varlistentry id="elogind-inhibit">
|
---|
| 377 | <term><command>elogind-inhibit</command></term>
|
---|
| 378 | <listitem>
|
---|
| 379 | <para>
|
---|
| 380 | is used to execute a program with a shutdown, sleep or idle
|
---|
[4c24eb0a] | 381 | inhibitor lock taken
|
---|
[ff3264f] | 382 | </para>
|
---|
| 383 | <indexterm zone="elogind elogind-inhibit">
|
---|
| 384 | <primary sortas="b-elogind-inhibit">elogind-inhibit</primary>
|
---|
| 385 | </indexterm>
|
---|
| 386 | </listitem>
|
---|
| 387 | </varlistentry>
|
---|
| 388 |
|
---|
| 389 | <varlistentry id="loginctl">
|
---|
| 390 | <term><command>loginctl</command></term>
|
---|
| 391 | <listitem>
|
---|
| 392 | <para>
|
---|
| 393 | is used to introspect and control the state of the elogind Login
|
---|
[4c24eb0a] | 394 | Manager
|
---|
[ff3264f] | 395 | </para>
|
---|
| 396 | <indexterm zone="elogind loginctl">
|
---|
| 397 | <primary sortas="b-loginctl">loginctl</primary>
|
---|
| 398 | </indexterm>
|
---|
| 399 | </listitem>
|
---|
| 400 | </varlistentry>
|
---|
| 401 |
|
---|
| 402 | <varlistentry id="libelogind">
|
---|
| 403 | <term><filename class="libraryfile">libelogind.so</filename></term>
|
---|
| 404 | <listitem>
|
---|
| 405 | <para>
|
---|
[4c24eb0a] | 406 | is the main elogind utility library
|
---|
[ff3264f] | 407 | </para>
|
---|
| 408 | <indexterm zone="elogind libelogind">
|
---|
| 409 | <primary sortas="c-libelogind">libelogind.so</primary>
|
---|
| 410 | </indexterm>
|
---|
| 411 | </listitem>
|
---|
| 412 | </varlistentry>
|
---|
| 413 |
|
---|
| 414 | </variablelist>
|
---|
| 415 |
|
---|
| 416 | </sect2>
|
---|
| 417 |
|
---|
[4c24eb0a] | 418 | </sect1>
|
---|