Browse Source

Prep v221: Update and clean up build system to sync with upstream

This commit replays the moving around of source files that have been
done between systemd-219 and systemd-221.

Further the Makefile.am is synchronized with the upstream version and
then "re-cleaned".

A lot of functions, that are not used anywhere in elogind have been
coated into #if 0/#endif directives to further shorten the list of
dependencies.

All unneeded files have been removed.
Sven Eden 5 years ago
parent
commit
1cfc78c919
  1. 1
      .gitignore
  2. 28
      CODING_STYLE
  3. 12
      Makefile-man.am
  4. 863
      Makefile.am
  5. 84
      NEWS
  6. 421
      README
  7. 27
      TODO
  8. 22
      autogen.sh
  9. 81
      configure.ac
  10. 1
      docs/gtk-doc.make
  11. 2
      factory/etc/pam.d/system-auth
  12. 88
      m4/gtk-doc.m4
  13. 3
      man/custom-html.xsl
  14. 31
      man/elogind.conf.xml
  15. 14
      man/loginctl.xml
  16. 6
      man/pam_elogind.xml
  17. 200
      man/sd_is_fifo.xml
  18. 33
      shell-completion/zsh/_elogind-inhibit
  19. 16
      src/basic/.gitignore
  20. 0
      src/basic/Makefile
  21. 0
      src/basic/audit.c
  22. 0
      src/basic/audit.h
  23. 88
      src/basic/btrfs-util.h
  24. 157
      src/basic/build.h
  25. 0
      src/basic/bus-label.c
  26. 0
      src/basic/bus-label.h
  27. 0
      src/basic/calendarspec.h
  28. 3
      src/basic/capability.c
  29. 4
      src/basic/capability.h
  30. 535
      src/basic/cgroup-util.c
  31. 19
      src/basic/cgroup-util.h
  32. 0
      src/basic/conf-files.c
  33. 0
      src/basic/conf-files.h
  34. 2
      src/basic/def.h
  35. 0
      src/basic/device-nodes.h
  36. 0
      src/basic/env-util.h
  37. 3
      src/basic/errno-list.c
  38. 2
      src/basic/errno-list.h
  39. 0
      src/basic/exit-status.h
  40. 8
      src/basic/fdset.h
  41. 3
      src/basic/fileio-label.c
  42. 6
      src/basic/fileio-label.h
  43. 6
      src/basic/fileio.c
  44. 4
      src/basic/fileio.h
  45. 0
      src/basic/gunicode.c
  46. 0
      src/basic/gunicode.h
  47. 15
      src/basic/hashmap.c
  48. 3
      src/basic/hashmap.h
  49. 0
      src/basic/hostname-util.c
  50. 0
      src/basic/hostname-util.h
  51. 0
      src/basic/ioprio.h
  52. 0
      src/basic/label.c
  53. 0
      src/basic/label.h
  54. 0
      src/basic/list.h
  55. 0
      src/basic/log.c
  56. 0
      src/basic/log.h
  57. 2
      src/basic/login-util.c
  58. 8
      src/basic/login-util.h
  59. 0
      src/basic/macro.h
  60. 3
      src/basic/memfd-util.c
  61. 2
      src/basic/memfd-util.h
  62. 2
      src/basic/mempool.c
  63. 2
      src/basic/mempool.h
  64. 39
      src/basic/missing.h
  65. 0
      src/basic/mkdir-label.c
  66. 0
      src/basic/mkdir.c
  67. 0
      src/basic/mkdir.h
  68. 6
      src/basic/path-util.c
  69. 4
      src/basic/path-util.h
  70. 0
      src/basic/prioq.c
  71. 0
      src/basic/prioq.h
  72. 6
      src/basic/process-util.c
  73. 10
      src/basic/process-util.h
  74. 2
      src/basic/random-util.c
  75. 0
      src/basic/random-util.h
  76. 0
      src/basic/ratelimit.h
  77. 0
      src/basic/refcnt.h
  78. 4
      src/basic/ring.h
  79. 21
      src/basic/rm-rf.c
  80. 0
      src/basic/rm-rf.h
  81. 3
      src/basic/selinux-util.c
  82. 2
      src/basic/selinux-util.h
  83. 2
      src/basic/set.h
  84. 2
      src/basic/signal-util.c
  85. 0
      src/basic/signal-util.h
  86. 0
      src/basic/siphash24.c
  87. 0
      src/basic/siphash24.h
  88. 0
      src/basic/smack-util.c
  89. 0
      src/basic/smack-util.h
  90. 8
      src/basic/socket-util.h
  91. 0
      src/basic/sparse-endian.h
  92. 2
      src/basic/special.h
  93. 15
      src/basic/strv.c
  94. 12
      src/basic/strv.h
  95. 6
      src/basic/terminal-util.c
  96. 4
      src/basic/terminal-util.h
  97. 9
      src/basic/time-util.c
  98. 10
      src/basic/time-util.h
  99. 0
      src/basic/unit-name.c
  100. 0
      src/basic/unit-name.h

1
.gitignore

@ -291,3 +291,4 @@ stamp-*
/elogind-cgroups-agent
/rebuild_all.sh
/src/libelogind/libelogind.pc
/elogind-inhibit

28
CODING_STYLE

@ -210,11 +210,12 @@
c) recvmsg() must get MSG_CMSG_CLOEXEC set
d) F_DUPFD_CLOEXEC should be used instead of F_DUPFD, and so on
- We never use the XDG version of basename(). glibc defines it in
libgen.h. The only reason to include that file is because dirname()
- We never use the POSIX version of basename() (which glibc defines it in
libgen.h), only the GNU version (which glibc defines in string.h).
The only reason to include libgen.h is because dirname()
is needed. Everytime you need that please immediately undefine
basename(), and add a comment about it, so that no code ever ends up
using the XDG version!
using the POSIX version!
- Use the bool type for booleans, not integers. One exception: in public
headers (i.e those in src/systemd/sd-*.h) use integers after all, as "bool"
@ -292,3 +293,24 @@
- When returning a return code from main(), please preferably use
EXIT_FAILURE and EXIT_SUCCESS as defined by libc.
- The order in which header files are included doesn't matter too
much. However, please try to include the headers of external
libraries first (these are all headers enclosed in <>), followed by
the headers of our own public headers (these are all headers
starting with "sd-"), internal utility libraries from src/shared/,
followed by the headers of the specific component. Or in other
words:
#include <stdio.h>
#include "sd-daemon.h"
#include "util.h"
#include "frobnicator.h"
Where stdio.h is a public glibc API, sd-daemon.h is a public API of
our own, util.h is a utility library header from src/shared, and
frobnicator.h is an placeholder name for any systemd component. The
benefit of following this ordering is that more local definitions
are always defined after more global ones. Thus, our local
definitions will never "leak" into the global header files, possibly
altering their effect due to #ifdeffery.

12
Makefile-man.am

@ -1,11 +1,10 @@
MANPAGES += \
man/loginctl.1 \
man/logind.conf.5 \
man/logind.8
man/elogind.conf.5
MANPAGES_ALIAS += \
man/logind.conf.d.5
man/logind.conf.d.5: man/logind.conf.5
man/logind.conf.d.html: man/logind.conf.html
man/elogind.conf.d.5
man/elogind.conf.d.5: man/elogind.conf.5
man/elogind.conf.d.html: man/elogind.conf.html
$(html-alias)
if HAVE_PAM
@ -228,8 +227,7 @@ endif
EXTRA_DIST += \
man/loginctl.xml \
man/logind.xml \
man/logind.conf.xml \
man/elogind.conf.xml \
man/pam_elogind.xml \
man/sd_get_seats.xml \
man/sd_login_monitor_new.xml \

863
Makefile.am

File diff suppressed because it is too large

84
NEWS

@ -1,5 +1,83 @@
systemd System and Service Manager
CHANGES WITH 221:
* The sd-bus.h and sd-event.h APIs have now been declared
stable and have been added to the official interface of
libsystemd.so. sd-bus implements an alternative D-Bus client
library, that is relatively easy to use, very efficient and
supports both classic D-Bus as well as kdbus as transport
backend. sd-event is a generic event loop abstraction that
is built around Linux epoll, but adds features such as event
prioritization or efficient timer handling. Both APIs are good
choices for C programs looking for a bus and/or event loop
implementation that is minimal and does not have to be
portable to other kernels.
* kdbus support is no longer compile-time optional. It is now
always built-in. However, it can still be disabled at
runtime using the kdbus=0 kernel command line setting, and
that setting may be changed to default to off, by specifying
--disable-kdbus at build-time. Note though that the kernel
command line setting has no effect if the kdbus.ko kernel
module is not installed, in which case kdbus is (obviously)
also disabled. We encourage all downstream distributions to
begin testing kdbus by adding it to the kernel images in the
development distributions, and leaving kdbus support in
systemd enabled.
* The minimal required util-linux version has been bumped to
2.26.
* Support for chkconfig (--enable-chkconfig) was removed in
favor of calling an abstraction tool
/lib/systemd/systemd-sysv-install. This needs to be
implemented for your distribution. See "SYSV INIT.D SCRIPTS"
in README for details.
* If there's a systemd unit and a SysV init script for the
same service name, and the user executes "systemctl enable"
for it (or a related call), then this will now enable both
(or execute the related operation on both), not just the
unit.
* The libudev API documentation has been converted from gtkdoc
into man pages.
* gudev has been removed from the systemd tree, it is now an
external project.
* The systemd-cgtop tool learnt a new --raw switch to generate
"raw" (machine parsable) output.
* networkd's IPForwarding= .network file setting learnt the
new setting "kernel", which ensures that networkd does not
change the IP forwarding sysctl from the default kernel
state.
* The systemd-logind bus API now exposes a new boolean
property "Docked" that reports whether logind considers the
system "docked", i.e. connected to a docking station or not.
Contributions from: Alex Crawford, Andreas Pokorny, Andrei
Borzenkov, Charles Duffy, Colin Guthrie, Cristian Rodríguez,
Daniele Medri, Daniel Hahler, Daniel Mack, David Herrmann,
David Mohr, Dimitri John Ledkov, Djalal Harouni, dslul, Ed
Swierk, Eric Cook, Filipe Brandenburger, Gianpaolo Macario,
Harald Hoyer, Iago López Galeiras, Igor Vuk, Jan Synacek,
Jason Pleau, Jason S. McMullan, Jean Delvare, Jeff Huang,
Jonathan Boulle, Karel Zak, Kay Sievers, kloun, Lennart
Poettering, Marc-Antoine Perennou, Marcel Holtmann, Mario
Limonciello, Martin Pitt, Michael Biebl, Michael Olbrich,
Michal Schmidt, Mike Gilbert, Nick Owens, Pablo Lezaeta Reyes,
Patrick Donnelly, Pavel Odvody, Peter Hutterer, Philip
Withnall, Ronny Chevalier, Simon McVittie, Susant Sahani,
Thomas Hindoe Paaboel Andersen, Tom Gundersen, Torstein
Husebø, Umut Tezduyar Lindskog, Viktar Vauchkevich, Werner
Fink, Zbigniew Jędrzejewski-Szmek
-- Berlin, 2015-06-19
CHANGES WITH 220:
* The gudev library has been extracted into a separate repository
@ -227,7 +305,7 @@ CHANGES WITH 220:
Gundersen, Torstein Husebø, Umut Tezduyar Lindskog, Will
Woods, Zachary Cook, Zbigniew Jędrzejewski-Szmek
-- Berlin, 2015-05-??
-- Berlin, 2015-05-22
CHANGES WITH 219:
@ -3997,7 +4075,7 @@ CHANGES WITH 191:
* HandleSleepKey= in logind.conf has been split up into
HandleSuspendKey= and HandleHibernateKey=. The old setting
is not available anymore. X11 and the kernel are
distuingishing between these keys and we should too. This
distinguishing between these keys and we should too. This
also means the inhibition lock for these keys has been split
into two.
@ -4743,7 +4821,7 @@ CHANGES WITH 43:
* Various functionality updates to libsystemd-login.so
* Track class of PAM logins to distuingish greeters from
* Track class of PAM logins to distinguish greeters from
normal user logins.
Contributions from: Kay Sievers, Lennart Poettering, Michael

421
README

@ -1,157 +1,264 @@
Elogind User, Seat and Session Manager
Introduction
------------
Elogind is the systemd project's "logind", extracted out to be a
standalone daemon. It integrates with PAM to know the set of users
that are logged in to a system and whether they are logged in
graphically, on the console, or remotely. Elogind exposes this
information via the standard org.freedesktop.login1 D-Bus interface,
as well as through the file system using systemd's standard
/run/systemd layout. Elogind also provides "libelogind", which is a
subset of the facilities offered by "libsystemd". There is a
"libelogind.pc" pkg-config file as well.
All of the credit for elogind should go to the systemd developers.
For more on systemd, see
http://www.freedesktop.org/wiki/Software/systemd. All of the blame
should go to Andy Wingo, who extracted elogind from systemd.
Contributing
------------
Elogind was branched from systemd version 219, and preserves the git
history of the systemd project. The version of elogind is the
upstream systemd version, followed by the patchlevel of elogind. For
example version 219.12 is the twelfth elogind release, which aims to
provide a subset of the interfaces of systemd 219.
To contribute to elogind, fork the current source code from github:
https://github.com/elogind/elogind
Send a pull request for the changes you like.
To chat about elogind:
#guix on irc.freenode.org
Finally, bug reports:
https://github.com/elogind/elogind/issues
Why bother?
-----------
Elogind has been developed for use in GuixSD, the OS distribution of
GNU Guix. See http://gnu.org/s/guix for more on Guix. GuixSD uses a
specific init manager (DMD), for reasons that are not relevant here,
but still aims to eventually be a full-featured distribution that can
run GNOME and other desktop environments. However, to run GNOME these
days means that you need to have support for the login1 D-Bus
interface, which is currently only provided by systemd. That is the
origin of this project: to take the excellent logind functionality
from systemd and provide it as a standalone package.
We like systemd. We realize that there are people out there that hate
it. You're welcome to use elogind for whatever purpose you like --
as-is, or as a jumping-off point for other things -- but please don't
use it as part of some anti-systemd vendetta. Systemd hackers are
smart folks that are trying to solve interesting problems on the free
desktop, and their large adoption is largely because they solve
problems that users and developers of user-focused applications care
about. We are appreciative of their logind effort and think that
everyone deserves to run it if they like, even if they use a different
PID 1.
Differences relative to systemd
-------------------------------
The pkg-config file is called libelogind, not libsystemd or
libsystemd-logind.
The headers are in <elogind/...>, so like <elogind/sd-login.h> instead
of <systemd/sd-login.h>.
Libelogind just implements login-related functionality. It also
provides the sd-bus API.
Unlike systemd, whose logind arranges to manage resources for user
sessions via RPC calls to systemd, in elogind there is no systemd so
there is no global cgroup-based resource management. This has a few
implications:
* Elogind does not create "slices" for users. Elogind will not
record that users are associated with slices.
* The /run/systemd/slices directory will always be empty.
* Elogind does not have the concept of a "scope", internally, as
it's the same as a session. Any API that refers to scopes will
always return an error code.
On the other hand, elogind does use a similar strategy to systemd in
that it places processes in a private cgroup for organizational
purposes, without installing any controllers (see
http://0pointer.de/blog/projects/cgroups-vs-cgroups.html). This
allows elogind to map arbitrary processes to sessions, even if the
process does the usual double-fork to be reparented to PID 1.
Elogind does not manage virtual terminals.
Elogind does monitor power button and the lid switch, like systemd,
but instead of doing RPC to systemd to suspend, poweroff, or restart
the machine, elogind just does this directly. For suspend, hybernate,
and hybrid-sleep, elogind uses the same code as systemd-sleep.
Instead of using a separate sleep.conf file to configure the sleep
behavior, this is included in the [Sleep] section of
/etc/elogind/login.conf. See the example login.conf for more. For
shutdown, reboot, and kexec, elogind shells out to "halt", "reboot",
and "kexec" binaries.
The loginctl command has the poweroff, reboot, sleep, hibernate, and
hybrid-sleep commands from systemd, as well as the --ignore-inhibitors
flag.
The PAM module is called pam_elogind.so, not pam_systemd.so.
License
-------
LGPLv2.1+ for all code
- except src/shared/MurmurHash2.c which is Public Domain
- except src/shared/siphash24.c which is CC0 Public Domain
- except src/journal/lookup3.c which is Public Domain
Dependencies
------------
glibc >= 2.14
libcap
libmount >= 2.20 (from util-linux)
libseccomp >= 1.0.0 (optional)
libblkid >= 2.24 (from util-linux) (optional)
PAM >= 1.1.2 (optional)
libacl (optional)
libselinux (optional)
make, gcc, and similar tools
During runtime, you need the following additional dependencies:
dbus >= 1.4.0 (strictly speaking optional, but recommended)
PolicyKit (optional)
When building from git, you need the following additional
dependencies:
pkg-config
docbook-xsl
xsltproc
automake
autoconf
libtool
intltool
gperf
gtkdocize (optional)
systemd System and Service Manager
DETAILS:
http://0pointer.de/blog/projects/systemd.html
WEB SITE:
http://www.freedesktop.org/wiki/Software/systemd
GIT:
git@github.com:systemd/systemd.git
https://github.com/systemd/systemd.git
GITWEB:
https://github.com/systemd/systemd
MAILING LIST:
http://lists.freedesktop.org/mailman/listinfo/systemd-devel
http://lists.freedesktop.org/mailman/listinfo/systemd-commits
IRC:
#systemd on irc.freenode.org
BUG REPORTS:
https://github.com/systemd/systemd/issues
AUTHOR:
Lennart Poettering
Kay Sievers
...and many others
LICENSE:
LGPLv2.1+ for all code
- except src/basic/MurmurHash2.c which is Public Domain
- except src/basic/siphash24.c which is CC0 Public Domain
- except src/journal/lookup3.c which is Public Domain
- except src/udev/* which is (currently still) GPLv2, GPLv2+
REQUIREMENTS:
Linux kernel >= 3.7
Linux kernel >= 3.8 for Smack support
Kernel Config Options:
CONFIG_DEVTMPFS
CONFIG_CGROUPS (it is OK to disable all controllers)
CONFIG_INOTIFY_USER
CONFIG_SIGNALFD
CONFIG_TIMERFD
CONFIG_EPOLL
CONFIG_NET
CONFIG_SYSFS
CONFIG_PROC_FS
CONFIG_FHANDLE (libudev, mount and bind mount handling)
udev will fail to work with the legacy sysfs layout:
CONFIG_SYSFS_DEPRECATED=n
Legacy hotplug slows down the system and confuses udev:
CONFIG_UEVENT_HELPER_PATH=""
Userspace firmware loading is not supported and should
be disabled in the kernel:
CONFIG_FW_LOADER_USER_HELPER=n
Some udev rules and virtualization detection relies on it:
CONFIG_DMIID
Support for some SCSI devices serial number retrieval, to
create additional symlinks in /dev/disk/ and /dev/tape:
CONFIG_BLK_DEV_BSG
Required for PrivateNetwork and PrivateDevices in service units:
CONFIG_NET_NS
CONFIG_DEVPTS_MULTIPLE_INSTANCES
Note that systemd-localed.service and other systemd units use
PrivateNetwork and PrivateDevices so this is effectively required.
Optional but strongly recommended:
CONFIG_IPV6
CONFIG_AUTOFS4_FS
CONFIG_TMPFS_XATTR
CONFIG_{TMPFS,EXT4,XFS,BTRFS_FS,...}_POSIX_ACL
CONFIG_SECCOMP
CONFIG_CHECKPOINT_RESTORE (for the kcmp() syscall)
Required for CPUShares in resource control unit settings
CONFIG_CGROUP_SCHED
CONFIG_FAIR_GROUP_SCHED
Required for CPUQuota in resource control unit settings
CONFIG_CFS_BANDWIDTH
For systemd-bootchart, several proc debug interfaces are required:
CONFIG_SCHEDSTATS
CONFIG_SCHED_DEBUG
For UEFI systems:
CONFIG_EFIVAR_FS
CONFIG_EFI_PARTITION
Note that kernel auditing is broken when used with systemd's
container code. When using systemd in conjunction with
containers, please make sure to either turn off auditing at
runtime using the kernel command line option "audit=0", or
turn it off at kernel compile time using:
CONFIG_AUDIT=n
If systemd is compiled with libseccomp support on
architectures which do not use socketcall() and where seccomp
is supported (this effectively means x86-64 and ARM, but
excludes 32-bit x86!), then nspawn will now install a
work-around seccomp filter that makes containers boot even
with audit being enabled. This works correctly only on kernels
3.14 and newer though. TL;DR: turn audit off, still.
glibc >= 2.16
libcap
libmount >= 2.20 (from util-linux)
libseccomp >= 1.0.0 (optional)
libblkid >= 2.24 (from util-linux) (optional)
libkmod >= 15 (optional)
PAM >= 1.1.2 (optional)
libcryptsetup (optional)
libaudit (optional)
libacl (optional)
libselinux (optional)
liblzma (optional)
liblz4 >= 119 (optional)
libgcrypt (optional)
libqrencode (optional)
libmicrohttpd (optional)
libpython (optional)
libidn (optional)
elfutils >= 158 (optional)
make, gcc, and similar tools
During runtime, you need the following additional
dependencies:
util-linux >= v2.26 required
dbus >= 1.4.0 (strictly speaking optional, but recommended)
dracut (optional)
PolicyKit (optional)
When building from git, you need the following additional
dependencies:
pkg-config
docbook-xsl
xsltproc
automake
autoconf
libtool
intltool
gperf
python (optional)
python-lxml (optional, but required to build the indices)
sphinx (optional)
When systemd-hostnamed is used, it is strongly recommended to
install nss-myhostname to ensure that, in a world of
dynamically changing hostnames, the hostname stays resolvable
under all circumstances. In fact, systemd-hostnamed will warn
if nss-myhostname is not installed.
To build HTML documentation for python-systemd using sphinx,
please first install systemd (using 'make install'), and then
invoke sphinx-build with 'make sphinx-<target>', with <target>
being 'html' or 'latexpdf'. If using DESTDIR for installation,
pass the same DESTDIR to 'make sphinx-html' invocation.
USERS AND GROUPS:
Default udev rules use the following standard system group
names, which need to be resolvable by getgrnam() at any time,
even in the very early boot stages, where no other databases
and network are available:
audio, cdrom, dialout, disk, input, kmem, lp, tape, tty, video
During runtime, the journal daemon requires the
"systemd-journal" system group to exist. New journal files will
be readable by this group (but not writable), which may be used
to grant specific users read access. In addition, system
groups "wheel" and "adm" will be given read-only access to
journal files using systemd-tmpfiles.service.
The journal gateway daemon requires the
"systemd-journal-gateway" system user and group to
exist. During execution this network facing service will drop
privileges and assume this uid/gid for security reasons.
Similarly, the NTP daemon requires the "systemd-timesync" system
user and group to exist.
Similarly, the network management daemon requires the
"systemd-network" system user and group to exist.
Similarly, the name resolution daemon requires the
"systemd-resolve" system user and group to exist.
Similarly, the kdbus dbus1 proxy daemon requires the
"systemd-bus-proxy" system user and group to exist.
NSS:
systemd ships with three NSS modules:
nss-myhostname resolves the local hostname to locally
configured IP addresses, as well as "localhost" to
127.0.0.1/::1.
nss-resolve enables DNS resolution via the systemd-resolved
DNS/LLMNR caching stub resolver "systemd-resolved".
nss-mymachines enables resolution of all local containers
registered with machined to their respective IP addresses.
To make use of these NSS modules, please add them to the
"hosts: " line in /etc/nsswitch.conf. The "resolve" module
should replace the glibc "dns" module in this file.
The three modules should be used in the following order:
hosts: files mymachines resolve myhostname
SYSV INIT.D SCRIPTS:
When calling "systemctl enable/disable/is-enabled" on a unit which is a
SysV init.d script, it calls /usr/lib/systemd/systemd-sysv-install;
this needs to translate the action into the distribution specific
mechanism such as chkconfig or update-rc.d. Packagers need to provide
this script if you need this functionality (you don't if you disabled
SysV init support).
Please see src/systemctl/systemd-sysv-install.SKELETON for how this
needs to look like, and provide an implementation at the marked places.
WARNINGS:
systemd will warn you during boot if /etc/mtab is not a
symlink to /proc/mounts. Please ensure that /etc/mtab is a
proper symlink.
systemd will warn you during boot if /usr is on a different
file system than /. While in systemd itself very little will
break if /usr is on a separate partition, many of its
dependencies very likely will break sooner or later in one
form or another. For example, udev rules tend to refer to
binaries in /usr, binaries that link to libraries in /usr or
binaries that refer to data files in /usr. Since these
breakages are not always directly visible, systemd will warn
about this, since this kind of file system setup is not really
supported anymore by the basic set of Linux OS components.
systemd requires that the /run mount point exists. systemd also
requires that /var/run is a symlink to /run.
For more information on this issue consult
http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken
To run systemd under valgrind, compile with VALGRIND defined
(e.g. ./configure CPPFLAGS='... -DVALGRIND=1'). Otherwise,
false positives will be triggered by code which violates
some rules but is actually safe.
ENGINEERING AND CONSULTING SERVICES:
ENDOCODE <https://endocode.com/> offers professional
engineering and consulting services for systemd. Please
contact Chris Kühl <chris@endocode.com> for more information.

27
TODO

@ -26,6 +26,31 @@ External:
Features:
* "systemctl edit" should know a mode to create a new unit file
* there's probably something wrong with having user mounts below /sys,
as we have for debugfs. for exmaple, src/core/mount.c handles mounts
prefixed with /sys generally special.
http://lists.freedesktop.org/archives/systemd-devel/2015-June/032962.html
* Add PassEnvironment= setting to service units, to import select env vars from PID 1 into the service env block
* nspawn: fix logic always print a final newline on output.
https://github.com/systemd/systemd/pull/272#issuecomment-113153176
* make nspawn's --network-veth switch more powerful:
http://lists.freedesktop.org/archives/systemd-devel/2015-June/033121.html
* man: document that unless you use StandardError=null the shell >/dev/stderr won't work in shell scripts in services
* man: clarify that "machinectl show" shows different information than "machinectl status" (no cgroup tree, no IP addresses, ...)
* "systemctl daemon-reload" should result in /etc/systemd/system.conf being reloaded by systemd
* install: include generator dirs in unit file search paths
* networkd: add support for configuring ipv6 privacy extensions
* introduce an NSS module that uses machined info to give container UIDs pretty names when user namespacing is used.
* stop using off_t, it's a crazy type. Use uint64_t instead.
@ -537,8 +562,6 @@ Features:
* maybe do not install getty@tty1.service symlink in /etc but in /usr?
* re-enable "make check" for gtk-doc (broken for unknown reason)
* fstab: add new mount option x-systemd-after=/foobar/waldo to allow manual dependencies to other mount points
https://bugzilla.redhat.com/show_bug.cgi?id=812826

22
autogen.sh

@ -21,21 +21,13 @@ oldpwd=$(pwd)
topdir=$(dirname $0)
cd $topdir
if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
# This part is allowed to fail
cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
chmod +x .git/hooks/pre-commit && \
echo "Activated pre-commit hook." || :
fi
if which gtkdocize >/dev/null 2>/dev/null; then
gtkdocize --docdir docs/ --flavour no-tmpl
gtkdocargs=--enable-gtk-doc
else
echo "You don't have gtk-doc installed, and thus won't be able to generate the documentation."
rm -f docs/gtk-doc.make
echo 'EXTRA_DIST =' > docs/gtk-doc.make
fi
# We do not need this, we are not systemd upstream!
#if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
# # This part is allowed to fail
# cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
# chmod +x .git/hooks/pre-commit && \
# echo "Activated pre-commit hook." || :
#fi
intltoolize --force --automake
autoreconf --force --install --symlink

81
configure.ac

@ -20,7 +20,7 @@
AC_PREREQ([2.64])
AC_INIT([elogind],
[220],
[221],
[https://github.com/elogind/elogind/issues],
[elogind],
[https://github.com/elogind/elogind])
@ -47,6 +47,7 @@ AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is
SET_ARCH(X86_64, x86_64*)
SET_ARCH(IA32, i*86*)
SET_ARCH(MIPS, mips*)
SET_ARCH(AARCH64, aarch64*)
# i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
AC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
@ -144,11 +145,9 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-pipe \
-Wall \
-Wextra \
-Wno-inline \
-Wundef \
"-Wformat=2 -Wformat-security -Wformat-nonliteral" \
-Wlogical-op \
-Wsign-compare \
-Wmissing-include-dirs \
-Wold-style-definition \
-Wpointer-arith \
@ -156,17 +155,18 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-Wdeclaration-after-statement \
-Wfloat-equal \
-Wsuggest-attribute=noreturn \
-Wmissing-prototypes \
-Werror=missing-prototypes \
-Werror=implicit-function-declaration \
-Werror=missing-declarations \
-Werror=return-type \
-Werror=shadow \
-Wstrict-prototypes \
-Wredundant-decls \
-Wmissing-declarations \
-Wmissing-noreturn \
-Wshadow \
-Wendif-labels \
-Wstrict-aliasing=2 \
-Wwrite-strings \
-Wno-long-long \
-Wno-overlength-strings \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
-Wno-unused-result \
@ -179,8 +179,6 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-fdiagnostics-show-option \
-fno-strict-aliasing \
-fvisibility=hidden \
-ffunction-sections \
-fdata-sections \
-fstack-protector \
-fstack-protector-strong \
-fPIE \
@ -204,10 +202,21 @@ AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
[AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
[CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
-Wl,--gc-sections])],
[AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
AC_SUBST([OUR_CFLAGS], "$with_ldflags $sanitizer_cflags")
AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
[CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-ffunction-sections -fdata-sections])],
[AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
-Wl,--as-needed \
-Wl,--no-undefined \
-Wl,--gc-sections \
-Wl,-z,relro \
-Wl,-z,now \
-pie \
@ -269,6 +278,7 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
IFLA_PHYS_PORT_ID,
IFLA_BOND_AD_INFO,
IFLA_VLAN_PROTOCOL,
IFLA_VXLAN_REMCSUM_NOPARTIAL,
IFLA_VXLAN_LOCAL6,
IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
IFLA_BRIDGE_VLAN_INFO,
@ -285,6 +295,7 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
#include <linux/if_tunnel.h>
#include <linux/if_link.h>
#include <linux/if_bridge.h>
#include <linux/if_addr.h>
#include <linux/neighbour.h>
]])
@ -310,7 +321,12 @@ AC_ARG_WITH([udevrulesdir],
[],
[with_udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)/rules.d])
AC_SUBST([udevrulesdir], [$with_udevrulesdir])
AC_SUBST([udevbindir], [$($PKG_CONFIG --variable=udevdir udev)/../bin])
AC_ARG_WITH([udevbindir],
AS_HELP_STRING([--with-udevbindir=DIR], [Directory for udev binary files]),
[],
[with_udevbindir=$($PKG_CONFIG --variable=udevdir udev)])
AC_SUBST([udevbindir], [$with_udevbindir])
# ------------------------------------------------------------------------------
have_coverage=no
@ -526,9 +542,9 @@ AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
# ------------------------------------------------------------------------------
have_kdbus=no
AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--enable-kdbus], [do connect to kdbus by default]))
if test "x$enable_kdbus" = "xyes"; then
AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus support is to be enabled])
AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--disable-kdbus], [do not connect to kdbus by default]))
if test "x$enable_kdbus" != "xno"; then
AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus is to be connected to by default])
have_kdbus=yes
M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
fi
@ -555,16 +571,13 @@ AC_ARG_WITH([dbuspolicydir],
AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
[],
[with_dbuspolicydir=${sysconfdir}/dbus-1/system.d])
AC_ARG_WITH([dbussessionservicedir],
AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
[],
[with_dbussessionservicedir=${datadir}/dbus-1/services])
AX_NORMALIZE_PATH([with_dbuspolicydir])
AC_ARG_WITH([dbussystemservicedir],
AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
[],
[with_dbussystemservicedir=${datadir}/dbus-1/system-services])
AX_NORMALIZE_PATH([with_dbussystemservicedir])
AC_ARG_WITH([bashcompletiondir],
AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
@ -574,25 +587,42 @@ AC_ARG_WITH([bashcompletiondir],
] , [
with_bashcompletiondir=${datadir}/bash-completion/completions
])])
AX_NORMALIZE_PATH([with_bashcompletiondir])
AC_ARG_WITH([zshcompletiondir],
AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
[], [with_zshcompletiondir=${datadir}/zsh/site-functions])
AX_NORMALIZE_PATH([with_zshcompletiondir])
AC_ARG_WITH([rootprefix],
AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
[], [with_rootprefix=${ac_default_prefix}])
# --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
# defaults those to ".", solve that here for now until we can find a suitable
# fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
# See: https://github.com/systemd/systemd/issues/54
if test "x${with_rootprefix}" = "x"; then
with_rootprefix="/"
fi
AX_NORMALIZE_PATH([with_rootprefix])
AC_ARG_WITH([rootlibdir],
AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
[],
[with_rootlibdir=${libdir}])
AX_NORMALIZE_PATH([with_rootlibdir])
AC_ARG_WITH([pamlibdir],
AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
[],
[with_pamlibdir=${with_rootlibdir}/security])
AX_NORMALIZE_PATH([with_pamlibdir])
AC_ARG_WITH([pamconfdir],
AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
[],
[with_pamconfdir=${sysconfdir}/pam.d])
AX_NORMALIZE_PATH([with_pamconfdir])
AC_ARG_ENABLE([split-usr],
AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
@ -606,10 +636,9 @@ AC_ARG_ENABLE([split-usr],
AS_IF([test "x${enable_split_usr}" = "xyes"], [
AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
])
AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
# Work around intltoolize and gtk-doc problems in VPATH builds
AM_CONDITIONAL([ENABLE_GTK_DOC_TESTS], [test "x$0" = "x./configure"],
[Define to do gtk-doc tests])
# work around intltool-update issues during 'make distcheck'
AS_IF([test "x$0" != "x./configure"], [
AC_SUBST([INTLTOOL_UPDATE], [/usr/bin/env true])
])
@ -650,16 +679,17 @@ AS_IF([test x$enable_debug_mmap_cache = xyes], [
test -z "$enable_debug" && enable_debug="none"
AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
AC_SUBST([pamlibdir], [$with_pamlibdir])
AC_SUBST([pamconfdir], [$with_pamconfdir])
AC_SUBST([rootprefix], [$with_rootprefix])
AC_SUBST([rootlibdir], [$with_rootlibdir])
AC_CONFIG_FILES([
Makefile po/Makefile.in
Makefile
po/Makefile.in
])
AC_OUTPUT
@ -677,12 +707,12 @@ AC_MSG_RESULT([
dbus: ${have_dbus}
kdbus: ${have_kdbus}
man pages: ${have_manpages}
gtk-doc: ${enable_gtk_doc}
test coverage: ${have_coverage}
Split /usr: ${enable_split_usr}
extra debugging: ${enable_debug}
prefix: ${prefix}
rootprefix: ${with_rootprefix}
sysconf dir: ${sysconfdir}
datarootdir: ${datarootdir}
includedir: ${includedir}
@ -691,7 +721,6 @@ AC_MSG_RESULT([
PAM modules dir: ${with_pamlibdir}
PAM configuration dir: ${with_pamconfdir}
D-Bus policy dir: ${with_dbuspolicydir}
D-Bus session dir: ${with_dbussessionservicedir}
D-Bus system dir: ${with_dbussystemservicedir}
Bash completions dir: ${with_bashcompletiondir}
Zsh completions dir: ${with_zshcompletiondir}

1
docs/gtk-doc.make

@ -0,0 +1 @@
/usr/share/gtk-doc/data/gtk-doc.notmpl.make

2
factory/etc/pam.d/system-auth

@ -8,5 +8,5 @@ account sufficient pam_unix.so
password sufficient pam_unix.so nullok sha512 shadow try_first_pass try_authtok
-session optional pam_loginuid.so
-session optional pam_systemd.so
-session optional pam_elogind.so
session sufficient pam_unix.so

88
m4/gtk-doc.m4

@ -0,0 +1,88 @@
dnl -*- mode: autoconf -*-
# serial 2
dnl Usage:
dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
AC_DEFUN([GTK_DOC_CHECK],
[
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"])
AC_MSG_CHECKING([for gtk-doc])
PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no])
AC_MSG_RESULT($have_gtk_doc)
if test "$have_gtk_doc" = "no"; then
AC_MSG_WARN([
You will not be able to create source packages with 'make dist'
because $gtk_doc_requires is not found.])
fi
dnl check for tools we added during development
dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that
dnl may not be writable by the user. Currently, automake requires that the
dnl test name must end in '.test'.
dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638
AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test])
AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check])
AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
dnl for overriding the documentation installation directory
AC_ARG_WITH([html-dir],
AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
[with_html_dir='${datadir}/gtk-doc/html'])
HTML_DIR="$with_html_dir"
AC_SUBST([HTML_DIR])
dnl enable/disable documentation building
AC_ARG_ENABLE([gtk-doc],
AS_HELP_STRING([--enable-gtk-doc],
[use gtk-doc to build documentation [[default=no]]]),,
[enable_gtk_doc=no])
AC_MSG_CHECKING([whether to build gtk-doc documentation])
AC_MSG_RESULT($enable_gtk_doc)
if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
AC_MSG_ERROR([
You must have $gtk_doc_requires installed to build documentation for
$PACKAGE_NAME. Please install gtk-doc or disable building the
documentation by adding '--disable-gtk-doc' to '[$]0'.])
fi
dnl don't check for glib if we build glib
if test "x$PACKAGE_NAME" != "xglib"; then
dnl don't fail if someone does not have glib
PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:])
fi
dnl enable/disable output formats
AC_ARG_ENABLE([gtk-doc-html],
AS_HELP_STRING([--enable-gtk-doc-html],
[build documentation in html format [[default=yes]]]),,
[enable_gtk_doc_html=yes])
AC_ARG_ENABLE([gtk-doc-pdf],
AS_HELP_STRING([--enable-gtk-doc-pdf],
[build documentation in pdf format [[default=no]]]),,
[enable_gtk_doc_pdf=no])
if test -z "$GTKDOC_MKPDF"; then
enable_gtk_doc_pdf=no
fi
if test -z "$AM_DEFAULT_VERBOSITY"; then
AM_DEFAULT_VERBOSITY=1
fi
AC_SUBST([AM_DEFAULT_VERBOSITY])
AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes])
AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])
AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"])
])

3
man/custom-html.xsl

@ -271,9 +271,10 @@
<xsl:text>index.html</xsl:text>
</xsl:attribute>
<xsl:text>Index </xsl:text>
</a>
<span style="float:right">
<xsl:text>elogind </xsl:text>
<xsl:text>elogind</xsl:text>
<xsl:value-of select="$elogind.version"/>
</span>
<hr/>

31
man/logind.conf.xml → man/elogind.conf.xml

@ -21,10 +21,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="logind.conf" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentry id="elogind.conf" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>logind.conf</title>
<productname>systemd</productname>
<title>elogind.conf</title>
<productname>elogind</productname>
<authorgroup>
<author>
@ -37,29 +37,25 @@
</refentryinfo>
<refmeta>
<refentrytitle>logind.conf</refentrytitle>
<refentrytitle>elogind.conf</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>logind.conf</refname>
<refname>logind.conf.d</refname>
<refname>elogind.conf</refname>
<refname>elogind.conf.d</refname>
<refpurpose>Login manager configuration files</refpurpose>
</refnamediv>
<refsynopsisdiv>
<para><filename>/etc/systemd/logind.conf</filename></para>
<para><filename>/etc/systemd/logind.conf.d/*.conf</filename></para>
<para><filename>/run/systemd/logind.conf.d/*.conf</filename></para>
<para><filename>/usr/lib/systemd/logind.conf.d/*.conf</filename></para>
<para><filename>/etc/elogind/elogind.conf</filename></para>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>These files configure various parameters of the systemd
<para>These files configure various parameters of the elogind
login manager,
<citerefentry><refentrytitle>logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
</para>
</refsect1>
@ -211,13 +207,13 @@
<term><varname>HoldoffTimeoutSec=</varname></term>
<listitem><para>Specifies the timeout after system startup or
system resume in which systemd will hold off on reacting to
system resume in which elogind will hold off on reacting to
LID events. This is required for the system to properly
detect any hotplugged devices so systemd can ignore LID events
detect any hotplugged devices so elogind can ignore LID events
if external monitors, or docks, are connected. If set to 0,
systemd will always react immediately, possibly before the
elogind will always react immediately, possibly before the
kernel fully probed all hotplugged devices. This is safe, as
long as you do not care for systemd to account for devices
long as you do not care for elogind to account for devices
that have been plugged or unplugged while the system was off.
Defaults to 30s.</para></listitem>
</varlistentry>
@ -257,10 +253,7 @@
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
</para>
</refsect1>

14
man/loginctl.xml

@ -25,7 +25,7 @@
<refentryinfo>
<title>loginctl</title>
<productname>systemd</productname>
<productname>elogind</productname>
<authorgroup>
<author>
@ -44,7 +44,7 @@
<refnamediv>
<refname>loginctl</refname>
<refpurpose>Control the systemd login manager</refpurpose>
<refpurpose>Control the elogind login manager</refpurpose>
</refnamediv>
<refsynopsisdiv>
@ -60,10 +60,7 @@
<title>Description</title>
<para><command>loginctl</command> may be used to introspect and
control the state of the
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
login manager
<citerefentry><refentrytitle>logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
control the state of the elogind login manager</para>
</refsect1>
<refsect1>
@ -404,10 +401,7 @@
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
<citerefentry><refentrytitle>elogind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
</para>
</refsect1>

6
man/pam_elogind.xml

@ -88,7 +88,7 @@
<orderedlist>
<listitem><para>If enabled in
<citerefentry><refentrytitle>logind.conf</refentrytitle>
<citerefentry><refentrytitle>elogind.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry>, all processes of the
session are terminated. If the last concurrent session of a user
ends, the user's elogind instance will be terminated too, and so
@ -279,8 +279,8 @@ session required pam_elogind.so</programlisting>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>logind</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>elogind</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>elogind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,

200
man/sd_is_fifo.xml

@ -0,0 +1,200 @@
<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_is_fifo"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_is_fifo</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_is_fifo</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_is_fifo</refname>
<refname>sd_is_socket</refname>
<refname>sd_is_socket_inet</refname>
<refname>sd_is_socket_unix</refname>
<refname>sd_is_mq</refname>
<refname>sd_is_special</refname>
<refpurpose>Check the type of a file descriptor</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-daemon.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_is_fifo</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_is_socket</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>family</parameter></paramdef>
<paramdef>int <parameter>type</parameter></paramdef>
<paramdef>int <parameter>listening</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_is_socket_inet</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>family</parameter></paramdef>
<paramdef>int <parameter>type</parameter></paramdef>
<paramdef>int <parameter>listening</parameter></paramdef>
<paramdef>uint16_t <parameter>port</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_is_socket_unix</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>type</parameter></paramdef>
<paramdef>int <parameter>listening</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>size_t <parameter>length</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_is_mq</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_is_special</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_is_fifo()</function> may be called to check
whether the specified file descriptor refers to a FIFO or pipe. If
the <parameter>path</parameter> parameter is not
<constant>NULL</constant>, it is checked whether the FIFO is bound
to the specified file system path.</para>
<para><function>sd_is_socket()</function> may be called to check
whether the specified file descriptor refers to a socket. If the
<parameter>family</parameter> parameter is not
<constant>AF_UNSPEC</constant>, it is checked whether the socket
is of the specified family (AF_UNIX, <constant>AF_INET</constant>,
...). If the <parameter>type</parameter> parameter is not 0, it is
checked whether the socket is of the specified type
(<constant>SOCK_STREAM</constant>,
<constant>SOCK_DGRAM</constant>, ...). If the
<parameter>listening</parameter> parameter is positive, it is
checked whether the socket is in accepting mode, i.e.
<function>listen()</function> has been called for it. If
<parameter>listening</parameter> is 0, it is checked whether the
socket is not in this mode. If the parameter is negative, no such
check is made. The <parameter>listening</parameter> parameter
should only be used for stream sockets and should be set to a
negative value otherwise.</para>
<para><function>sd_is_socket_inet()</function> is similar to
<function>sd_is_socket()</function>, but optionally checks the
IPv4 or IPv6 port number the socket is bound to, unless
<parameter>port</parameter> is zero. For this call
<parameter>family</parameter> must be passed as either
<constant>AF_UNSPEC</constant>, <constant>AF_INET</constant>, or
<constant>AF_INET6</constant>.</para>
<para><function>sd_is_socket_unix()</function> is similar to
<function>sd_is_socket()</function> but optionally checks the
<constant>AF_UNIX</constant> path the socket is bound to, unless
the <parameter>path</parameter> parameter is
<constant>NULL</constant>. For normal file system
<constant>AF_UNIX</constant> sockets, set the
<parameter>length</parameter> parameter to 0. For Linux abstract
namespace sockets, set the <parameter>length</parameter> to the
size of the address, including the initial 0 byte, and set the
<parameter>path</parameter> to the initial 0 byte of the socket
address.</para>
<para><function>sd_is_mq()</function> may be called to check
whether the specified file descriptor refers to a POSIX message
queue. If the <parameter>path</parameter> parameter is not
<constant>NULL</constant>, it is checked whether the message queue
is bound to the specified name.</para>
<para><function>sd_is_special()</function> may be called to check
whether the specified file descriptor refers to a special file. If
the <parameter>path</parameter> parameter is not
<constant>NULL</constant>, it is checked whether the file
descriptor is bound to the specified file name. Special files in
this context are character device nodes and files in
<filename>/proc</filename> or <filename>/sys</filename>.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On failure, these calls return a negative errno-style error
code. If the file descriptor is of the specified type and bound to
the specified address, a positive return value is returned,
otherwise zero.</para>
</refsect1>
<refsect1>
<title>Notes</title>
<xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
<para>Internally, these function use a combination of
<filename>fstat()</filename> and
<filename>getsockname()</filename> to check the file descriptor
type and where it is bound to.</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

33
shell-completion/zsh/_elogind-inhibit

@ -0,0 +1,33 @@
#compdef systemd-inhibit
_systemd_inhibit_command(){
if (( CURRENT == 1 )); then
compset -q
_normal
else
local n=${words[(b:2:i)[^-]*]}
if (( n <= CURRENT )); then
compset -n $n
_alternative \
'files:file:_files' \
'commands:command:_normal' && return 0
fi
_default
fi
}
_inhibit_what() {
local _inhibit
_inhibit=(shutdown sleep idle handle-power-key handle-suspend-key handle-hibernate-key handle-lid-switch)
_values -s : "${_inhibit[@]}"
}
_arguments \
{-h,--help}'[Show this help]' \
'--version[Show package version]' \
'--what=[Operations to inhibit]:options:_inhibit_what' \
'--who=[A descriptive string who is inhibiting]' \
'--why=[A descriptive string why is being inhibited]' \
'--mode=[One of block or delay]' \
'--list[List active inhibitors]' \
'*:commands:_systemd_inhibit_command'

16
src/basic/.gitignore

@ -0,0 +1,16 @@
/cap-from-name.gperf
/cap-from-name.h
/cap-list.txt
/cap-to-name.h
/errno-from-name.gperf
/errno-from-name.h
/errno-list.txt
/errno-to-name.h
/af-from-name.gperf
/af-from-name.h
/af-list.txt
/af-to-name.h
/arphrd-from-name.gperf
/arphrd-from-name.h
/arphrd-list.txt
/arphrd-to-name.h

0
src/shared/Makefile → src/basic/Makefile

0
src/shared/audit.c → src/basic/audit.c

0
src/shared/audit.h → src/basic/audit.h

88
src/basic/btrfs-util.h

@ -0,0 +1,88 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2014 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#pragma once
#include <stdbool.h>
#include <sys/types.h>
#include "time-util.h"
typedef struct BtrfsSubvolInfo {
uint64_t subvol_id;
usec_t otime;
sd_id128_t uuid;
sd_id128_t parent_uuid;
bool read_only;
} BtrfsSubvolInfo;
typedef struct BtrfsQuotaInfo {
uint64_t referenced;
uint64_t exclusive;
uint64_t referenced_max;
uint64_t exclusive_max;
} BtrfsQuotaInfo;
typedef enum BtrfsSnapshotFlags {
BTRFS_SNAPSHOT_FALLBACK_COPY = 1,
BTRFS_SNAPSHOT_READ_ONLY = 2,
BTRFS_SNAPSHOT_RECURSIVE = 4,
} BtrfsSnapshotFlags;
int btrfs_is_filesystem(int fd);
int btrfs_is_subvol(int fd);
int btrfs_subvol_make(const char *path);
int btrfs_subvol_make_label(const char *path);
int btrfs_subvol_snapshot_fd(int old_fd, const char *new_path, BtrfsSnapshotFlags flags);
int btrfs_subvol_snapshot(const char *old_path, const char *new_path, BtrfsSnapshotFlags flags);
int btrfs_subvol_set_read_only_fd(int fd, bool b);
int btrfs_subvol_set_read_only(const char *path, bool b);
// UNNEEDED int btrfs_subvol_get_read_only_fd(int fd);
int btrfs_subvol_get_id(int fd, const char *subvolume, uint64_t *ret);
int btrfs_subvol_get_id_fd(int fd, uint64_t *ret);
int btrfs_subvol_get_info_fd(int fd, BtrfsSubvolInfo *info);
int btrfs_subvol_get_quota_fd(int fd, BtrfsQuotaInfo *quota);
int btrfs_reflink(int infd, int outfd);
// UNNEEDED int btrfs_clone_range(int infd, uint64_t in_offset, int ofd, uint64_t out_offset, uint64_t sz);
int btrfs_get_block_device_fd(int fd, dev_t *dev);
int btrfs_get_block_device(const char *path, dev_t *dev);
int btrfs_defrag_fd(int fd);
int btrfs_defrag(const char *p);
int btrfs_quota_enable_fd(int fd, bool b);
int btrfs_quota_enable(const char *path, bool b);
int btrfs_quota_limit_fd(int fd, uint64_t referenced_max);
int btrfs_quota_limit(const char *path, uint64_t referenced_max);
int btrfs_resize_loopback_fd(int fd, uint64_t size, bool grow_only);
int btrfs_resize_loopback(const char *path, uint64_t size, bool grow_only);
int btrfs_subvol_remove(const char *path, bool recursive);
int btrfs_subvol_remove_fd(int fd, const char *subvolume, bool recursive);

157
src/basic/build.h

@ -0,0 +1,157 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#ifdef HAVE_PAM
#define _PAM_FEATURE_ "+PAM"
#else
#define _PAM_FEATURE_ "-PAM"
#endif
#ifdef HAVE_AUDIT
#define _AUDIT_FEATURE_ "+AUDIT"
#else
#define _AUDIT_FEATURE_ "-AUDIT"
#endif
#ifdef HAVE_SELINUX
#define _SELINUX_FEATURE_ "+SELINUX"
#else
#define _SELINUX_FEATURE_ "-SELINUX"
#endif
#ifdef HAVE_APPARMOR
#define _APPARMOR_FEATURE_ "+APPARMOR"
#else
#define _APPARMOR_FEATURE_ "-APPARMOR"
#endif
#ifdef HAVE_IMA
#define _IMA_FEATURE_ "+IMA"
#else
#define _IMA_FEATURE_ "-IMA"
#endif
#ifdef HAVE_SMACK
#define _SMACK_FEATURE_ "+SMACK"
#else
#define _SMACK_FEATURE_ "-SMACK"
#endif
#ifdef HAVE_SYSV_COMPAT
#define _SYSVINIT_FEATURE_ "+SYSVINIT"
#else
#define _SYSVINIT_FEATURE_ "-SYSVINIT"
#endif
#ifdef HAVE_UTMP
#define _UTMP_FEATURE_ "+UTMP"
#else
#define _UTMP_FEATURE_ "-UTMP"
#endif
#ifdef HAVE_LIBCRYPTSETUP
#define _LIBCRYPTSETUP_FEATURE_ "+LIBCRYPTSETUP"
#else
#define _LIBCRYPTSETUP_FEATURE_ "-LIBCRYPTSETUP"
#endif
#ifdef HAVE_GCRYPT
#define _GCRYPT_FEATURE_ "+GCRYPT"