[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 " ">
|
---|
[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 |
|
---|
[172c283] | 40 | &lfs120_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 |
|
---|
[1db852a] | 141 | <screen><userinput><!--sed -i '/Disable polkit/,+8 d' meson.build &&
|
---|
[65d85668] | 142 |
|
---|
[27e5cd4c] | 143 | sed '/request_name/i\
|
---|
| 144 | r = sd_bus_set_exit_on_disconnect(m->bus, true);\
|
---|
| 145 | if (r < 0)\
|
---|
| 146 | return log_error_errno(r, "Failed to set exit on disconnect: %m");' \
|
---|
| 147 | -i src/login/logind.c &&
|
---|
| 148 |
|
---|
[1db852a] | 149 | -->mkdir build &&
|
---|
[488cea3] | 150 | cd build &&
|
---|
[ff3264f] | 151 |
|
---|
[1db852a] | 152 | meson setup .. \
|
---|
| 153 | --prefix=/usr \
|
---|
| 154 | --buildtype=release \
|
---|
| 155 | -Dman=auto \
|
---|
| 156 | -Ddocdir=/usr/share/doc/elogind-&elogind-version; \
|
---|
| 157 | -Dcgroup-controller=elogind \
|
---|
[1a743079] | 158 | -Ddev-kvm-mode=0660 \
|
---|
[91318eb] | 159 | -Ddbuspolicydir=/etc/dbus-1/system.d &&
|
---|
[ff3264f] | 160 | ninja</userinput></screen>
|
---|
| 161 |
|
---|
| 162 | <para>
|
---|
[cce4984] | 163 | To test the results, issue: <command>ninja test</command>. A few tests
|
---|
| 164 | are skipped if not run with <systemitem class="username">root</systemitem>
|
---|
[eb9f0ef] | 165 | privileges. Two tests named <filename>test-fs-util</filename> and
|
---|
| 166 | <filename>test-id128</filename> require the
|
---|
| 167 | <filename>/etc/machine-id</filename> symlink, so they will fail if
|
---|
| 168 | this symlink is not created following the instruction in
|
---|
| 169 | <xref linkend='dbus'/> yet.
|
---|
[ff3264f] | 170 | </para>
|
---|
| 171 |
|
---|
| 172 | <para>
|
---|
| 173 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 174 | </para>
|
---|
| 175 |
|
---|
[1ede364c] | 176 | <screen role="root"><userinput>ninja install &&
|
---|
[ff3264f] | 177 | ln -sfv libelogind.pc /usr/lib/pkgconfig/libsystemd.pc &&
|
---|
| 178 | ln -sfvn elogind /usr/include/systemd</userinput></screen>
|
---|
| 179 |
|
---|
| 180 | </sect2>
|
---|
| 181 |
|
---|
| 182 | <sect2 role="commands">
|
---|
| 183 | <title>Command Explanations</title>
|
---|
[1db852a] | 184 | <!--
|
---|
[65d85668] | 185 | <para>
|
---|
| 186 | <command>sed ... meson.build</command>: This change allows the
|
---|
| 187 | package to be built without polkit being installed (it is still a
|
---|
[8558044] | 188 | runtime dependency) but able to use polkit after that package is
|
---|
[65d85668] | 189 | installed.
|
---|
| 190 | </para>
|
---|
| 191 |
|
---|
[27e5cd4c] | 192 | <para>
|
---|
| 193 | <command>sed ... src/login/logind.c</command>: This change allows the
|
---|
| 194 | elogind daemon to exit when it is disconnected from dbus (for example
|
---|
| 195 | when dbus is killed).
|
---|
| 196 | </para>
|
---|
[1db852a] | 197 | -->
|
---|
| 198 | <para>
|
---|
| 199 | <parameter>-Ddocdir=/usr/share/doc/elogind-&elogind-version;</parameter>:
|
---|
| 200 | This is needed to install documentation in a versioned directory.
|
---|
| 201 | </para>
|
---|
[27e5cd4c] | 202 |
|
---|
[ff3264f] | 203 | <para>
|
---|
[b980f67] | 204 | <parameter>-Dcgroup-controller=elogind</parameter>: This switch is
|
---|
| 205 | necessary to build this package when the kernel is not built with
|
---|
| 206 | <option>CONFIG_CGROUPS</option> enabled. Note that
|
---|
| 207 | <application>elogind</application> strictly needs
|
---|
| 208 | a kernel with <option>CONFIG_CGROUPS</option> enabled at runtime,
|
---|
| 209 | but this switch will allow building the package first.
|
---|
[ff3264f] | 210 | </para>
|
---|
| 211 |
|
---|
| 212 | <para>
|
---|
| 213 | <parameter>-Ddbuspolicydir=/etc/dbus-1/system.d</parameter>: This switch
|
---|
| 214 | sets the location of the <application>D-Bus</application> policy
|
---|
| 215 | directory.
|
---|
| 216 | </para>
|
---|
[adb90981] | 217 |
|
---|
[1a743079] | 218 | <para>
|
---|
[778470d] | 219 | <parameter>-Ddev-kvm-mode=0660</parameter>: The LFS udev rule sets the
|
---|
| 220 | mode of <filename class='devicefile'>/dev/kvm</filename> to 0660.
|
---|
| 221 | This option ensures the elogind udev rules consistent with the LFS
|
---|
| 222 | configuration.
|
---|
[1a743079] | 223 | </para>
|
---|
| 224 |
|
---|
[cce4984] | 225 | <para>
|
---|
| 226 | <parameter>-Dman=auto</parameter>: The default value of this switch is
|
---|
| 227 | <emphasis>false</emphasis>. Setting it to <emphasis>auto</emphasis>
|
---|
| 228 | allows building and installing the man pages if the recommended
|
---|
| 229 | dependencies are installed.
|
---|
[adb90981] | 230 | </para>
|
---|
[ff3264f] | 231 |
|
---|
[1db852a] | 232 | <para>
|
---|
| 233 | <option>-Dhtml=auto</option>: The default value of this switch is
|
---|
| 234 | <emphasis>false</emphasis>. Setting it to <emphasis>auto</emphasis>
|
---|
| 235 | allows building and installing the html documentation if the recommended
|
---|
| 236 | dependencies are installed.
|
---|
| 237 | </para>
|
---|
| 238 |
|
---|
[6545b53f] | 239 | <para>
|
---|
[76a6005] | 240 | <option>-Ddefault-kill-user-processes=false</option>: Determines whether
|
---|
[6545b53f] | 241 | the processes of a user should be killed when the user logs out. The
|
---|
| 242 | default is <emphasis>true</emphasis>, but this defeats the traditional
|
---|
| 243 | use of <command>screen</command> or <command>tmux</command>. This can
|
---|
| 244 | also be changed in the configuration file (see below).
|
---|
| 245 | </para>
|
---|
| 246 |
|
---|
[ff3264f] | 247 | <para>
|
---|
| 248 | <command>ln -s ...</command>: These commands install symlinks so that
|
---|
[76a6005] | 249 | software packages can find the systemd-compatible library and headers.
|
---|
[ff3264f] | 250 | </para>
|
---|
| 251 |
|
---|
| 252 | </sect2>
|
---|
| 253 |
|
---|
| 254 | <sect2 role="configuration">
|
---|
| 255 | <title>Configuring elogind</title>
|
---|
| 256 |
|
---|
[6545b53f] | 257 | <sect3 id="elogind-config">
|
---|
| 258 | <title>Config File</title>
|
---|
| 259 | <para>
|
---|
| 260 | <filename>/etc/elogind/logind.conf</filename>
|
---|
| 261 | </para>
|
---|
| 262 |
|
---|
| 263 | <indexterm zone="elogind elogind-config">
|
---|
| 264 | <primary
|
---|
| 265 | sortas="e-etc-elogind-logind.conf">/etc/elogind/logind.conf</primary>
|
---|
| 266 | </indexterm>
|
---|
| 267 | </sect3>
|
---|
| 268 |
|
---|
| 269 | <sect3><title>Configuration Information</title>
|
---|
| 270 |
|
---|
| 271 | <para>
|
---|
| 272 | The installed file <filename>/etc/elogind/logind.conf</filename>
|
---|
| 273 | contains all the possible options with their defaults, commented
|
---|
[76a6005] | 274 | out. You may wish to disable automatically killing user processes when the user logs
|
---|
[6545b53f] | 275 | out, by running, as the <systemitem class="username">root</systemitem>
|
---|
| 276 | user:
|
---|
| 277 | </para>
|
---|
| 278 |
|
---|
| 279 | <screen role="root"><userinput>sed -e '/\[Login\]/a KillUserProcesses=no' \
|
---|
| 280 | -i /etc/elogind/logind.conf</userinput></screen>
|
---|
| 281 |
|
---|
| 282 | <para>
|
---|
| 283 | Each user will need to register a user session using
|
---|
| 284 | <application>Linux-PAM</application> at login. The
|
---|
| 285 | <filename>/etc/pam.d/system-session</filename> file needs to
|
---|
[76a6005] | 286 | be modified and a new file must be created in order for
|
---|
[6545b53f] | 287 | <command>elogind</command> to work correctly. Run the following
|
---|
| 288 | commands as the <systemitem class="username">root</systemitem> user:
|
---|
| 289 | </para>
|
---|
[ff3264f] | 290 |
|
---|
| 291 | <screen role="root"><userinput>cat >> /etc/pam.d/system-session << "EOF" &&
|
---|
| 292 | <literal># Begin elogind addition
|
---|
[8558044] | 293 |
|
---|
[ff3264f] | 294 | session required pam_loginuid.so
|
---|
| 295 | session optional pam_elogind.so
|
---|
| 296 |
|
---|
| 297 | # End elogind addition</literal>
|
---|
| 298 | EOF
|
---|
| 299 | cat > /etc/pam.d/elogind-user << "EOF"
|
---|
| 300 | <literal># Begin /etc/pam.d/elogind-user
|
---|
| 301 |
|
---|
| 302 | account required pam_access.so
|
---|
| 303 | account include system-account
|
---|
| 304 |
|
---|
| 305 | session required pam_env.so
|
---|
| 306 | session required pam_limits.so
|
---|
| 307 | session required pam_unix.so
|
---|
| 308 | session required pam_loginuid.so
|
---|
| 309 | session optional pam_keyinit.so force revoke
|
---|
| 310 | session optional pam_elogind.so
|
---|
| 311 |
|
---|
| 312 | auth required pam_deny.so
|
---|
| 313 | password required pam_deny.so
|
---|
| 314 |
|
---|
| 315 | # End /etc/pam.d/elogind-user</literal>
|
---|
| 316 | EOF</userinput></screen>
|
---|
| 317 |
|
---|
[6545b53f] | 318 | </sect3>
|
---|
[ff3264f] | 319 | </sect2>
|
---|
| 320 |
|
---|
| 321 | <sect2 role="content" revision="sysv">
|
---|
| 322 | <title>Contents</title>
|
---|
| 323 |
|
---|
| 324 | <segmentedlist>
|
---|
| 325 | <segtitle>Installed Programs</segtitle>
|
---|
| 326 | <segtitle>Installed Library</segtitle>
|
---|
| 327 | <segtitle>Installed Directories</segtitle>
|
---|
| 328 |
|
---|
| 329 | <seglistitem>
|
---|
| 330 | <seg>
|
---|
| 331 | busctl,
|
---|
| 332 | elogind-inhibit, and
|
---|
| 333 | loginctl
|
---|
| 334 | </seg>
|
---|
| 335 | <seg>
|
---|
| 336 | libelogind.so
|
---|
| 337 | </seg>
|
---|
| 338 | <seg>
|
---|
[1db852a] | 339 | /usr/lib/elogind,
|
---|
[ff3264f] | 340 | /etc/elogind,
|
---|
| 341 | /usr/include/elogind, and
|
---|
| 342 | /usr/share/doc/elogind-&elogind-version;
|
---|
| 343 | </seg>
|
---|
| 344 | </seglistitem>
|
---|
| 345 | </segmentedlist>
|
---|
| 346 |
|
---|
| 347 | <variablelist>
|
---|
| 348 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 349 | <?dbfo list-presentation="list"?>
|
---|
| 350 | <?dbhtml list-presentation="table"?>
|
---|
| 351 |
|
---|
| 352 | <varlistentry id="busctl">
|
---|
| 353 | <term><command>busctl</command></term>
|
---|
| 354 | <listitem>
|
---|
| 355 | <para>
|
---|
[4c24eb0a] | 356 | is used to introspect and monitor the D-Bus bus
|
---|
[ff3264f] | 357 | </para>
|
---|
| 358 | <indexterm zone="elogind busctl">
|
---|
| 359 | <primary sortas="b-busctl">busctl</primary>
|
---|
| 360 | </indexterm>
|
---|
| 361 | </listitem>
|
---|
| 362 | </varlistentry>
|
---|
| 363 |
|
---|
| 364 | <varlistentry id="elogind-inhibit">
|
---|
| 365 | <term><command>elogind-inhibit</command></term>
|
---|
| 366 | <listitem>
|
---|
| 367 | <para>
|
---|
| 368 | is used to execute a program with a shutdown, sleep or idle
|
---|
[4c24eb0a] | 369 | inhibitor lock taken
|
---|
[ff3264f] | 370 | </para>
|
---|
| 371 | <indexterm zone="elogind elogind-inhibit">
|
---|
| 372 | <primary sortas="b-elogind-inhibit">elogind-inhibit</primary>
|
---|
| 373 | </indexterm>
|
---|
| 374 | </listitem>
|
---|
| 375 | </varlistentry>
|
---|
| 376 |
|
---|
| 377 | <varlistentry id="loginctl">
|
---|
| 378 | <term><command>loginctl</command></term>
|
---|
| 379 | <listitem>
|
---|
| 380 | <para>
|
---|
| 381 | is used to introspect and control the state of the elogind Login
|
---|
[4c24eb0a] | 382 | Manager
|
---|
[ff3264f] | 383 | </para>
|
---|
| 384 | <indexterm zone="elogind loginctl">
|
---|
| 385 | <primary sortas="b-loginctl">loginctl</primary>
|
---|
| 386 | </indexterm>
|
---|
| 387 | </listitem>
|
---|
| 388 | </varlistentry>
|
---|
| 389 |
|
---|
| 390 | <varlistentry id="libelogind">
|
---|
| 391 | <term><filename class="libraryfile">libelogind.so</filename></term>
|
---|
| 392 | <listitem>
|
---|
| 393 | <para>
|
---|
[4c24eb0a] | 394 | is the main elogind utility library
|
---|
[ff3264f] | 395 | </para>
|
---|
| 396 | <indexterm zone="elogind libelogind">
|
---|
| 397 | <primary sortas="c-libelogind">libelogind.so</primary>
|
---|
| 398 | </indexterm>
|
---|
| 399 | </listitem>
|
---|
| 400 | </varlistentry>
|
---|
| 401 |
|
---|
| 402 | </variablelist>
|
---|
| 403 |
|
---|
| 404 | </sect2>
|
---|
| 405 |
|
---|
[4c24eb0a] | 406 | </sect1>
|
---|