Ninjatrappeur's systemd working tree
Go to file
Lennart Poettering 4b58153dd2 core: add "invocation ID" concept to service manager
This adds a new invocation ID concept to the service manager. The invocation ID
identifies each runtime cycle of a unit uniquely. A new randomized 128bit ID is
generated each time a unit moves from and inactive to an activating or active
state.

The primary usecase for this concept is to connect the runtime data PID 1
maintains about a service with the offline data the journal stores about it.
Previously we'd use the unit name plus start/stop times, which however is
highly racy since the journal will generally process log data after the service
already ended.

The "invocation ID" kinda matches the "boot ID" concept of the Linux kernel,
except that it applies to an individual unit instead of the whole system.

The invocation ID is passed to the activated processes as environment variable.
It is additionally stored as extended attribute on the cgroup of the unit. The
latter is used by journald to automatically retrieve it for each log logged
message and attach it to the log entry. The environment variable is very easily
accessible, even for unprivileged services. OTOH the extended attribute is only
accessible to privileged processes (this is because cgroupfs only supports the
"trusted." xattr namespace, not "user."). The environment variable may be
altered by services, the extended attribute may not be, hence is the better
choice for the journal.

Note that reading the invocation ID off the extended attribute from journald is
racy, similar to the way reading the unit name for a logging process is.

This patch adds APIs to read the invocation ID to sd-id128:
sd_id128_get_invocation() may be used in a similar fashion to
sd_id128_get_boot().

PID1's own logging is updated to always include the invocation ID when it logs
information about a unit.

A new bus call GetUnitByInvocationID() is added that allows retrieving a bus
path to a unit by its invocation ID. The bus path is built using the invocation
ID, thus providing a path for referring to a unit that is valid only for the
current runtime cycleof it.

Outlook for the future: should the kernel eventually allow passing of cgroup
information along AF_UNIX/SOCK_DGRAM messages via a unique cgroup id, then we
can alter the invocation ID to be generated as hash from that rather than
entirely randomly. This way we can derive the invocation race-freely from the
messages.
2016-10-07 20:14:38 +02:00
.github documentation: add a short document describing how to test your systemd build tree (#3763) 2016-07-20 22:15:54 -04:00
.mkosi mkosi: install Fedora 25 2016-10-06 11:54:24 -04:00
catalog catalog,po: update Polish translation (#4290) 2016-10-05 22:59:37 +02:00
coccinelle tree-wide: htonl() is weird, let's use htobe32() instead (#3538) 2016-06-15 01:26:01 +02:00
docs docs: add .gitignore 2015-07-06 17:47:38 +02:00
factory/etc factory: remove broken pam_limits 2014-07-30 15:21:54 +02:00
hwdb hwdb: Update database of Bluetooth company identifiers 2016-09-15 22:09:35 +02:00
m4 build-sys: Perform flag tests in context to existing flags 2016-02-06 14:57:46 +01:00
man core: add "invocation ID" concept to service manager 2016-10-07 20:14:38 +02:00
network network: allow LLDP packets to cross non-customer bridges for container network interfaces 2016-05-09 15:45:31 +02:00
po catalog,po: update Polish translation (#4290) 2016-10-05 22:59:37 +02:00
rules rules: introduce disk/by-id (model_serial) symlinks for NVMe drives (#3974) 2016-08-17 14:10:28 +02:00
shell-completion shell-completion: add --wait to systemd-run completions (#4140) 2016-09-14 22:38:53 +02:00
src core: add "invocation ID" concept to service manager 2016-10-07 20:14:38 +02:00
sysctl.d treewide: fix typos and remove accidental repetition of words 2016-07-11 16:18:43 +02:00
system-preset units: synchronize Makefile and presets settings 2016-08-19 09:55:55 -04:00
sysusers.d remove bus-proxyd 2016-02-12 19:10:01 +01:00
test systemctl: Add --wait option to wait until started units terminate again 2016-10-01 17:58:59 +02:00
tmpfiles.d treewide: fix typos and remove accidental repetition of words 2016-07-11 16:18:43 +02:00
tools Remove systemd-bootchart 2016-02-23 13:30:09 +01:00
units units: systemd-udevd: add AF_INET and AF_INET6 to RestrictAddressFamilies= (#4296) 2016-10-06 15:40:53 +02:00
xorg login: support user-bus on dbus1 2015-08-31 18:12:37 +02:00
.dir-locals.el editors: only extend line width to 119 for C and XML files 2016-02-10 12:29:32 +01:00
.editorconfig editors: only extend line width to 119 for C and XML files 2016-02-10 12:29:32 +01:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore gitignore: ignore image.raw from mkosi (#4141) 2016-09-14 19:15:21 +02:00
.mailmap NEWS: update mailmap to bring NEWS and "make git-contrib" in line 2016-07-25 15:03:46 +02:00
.travis.yml remove gudev and gtk-doc 2015-06-03 00:22:53 +02:00
.vimrc vimrc: fix indentation logic for our docbook xml files 2016-04-29 12:23:34 +02:00
.ycm_extra_conf.py ycm: update flag blacklist 2014-06-04 15:41:10 -04:00
CODING_STYLE CODING_STYLE fixes (#3804) 2016-07-25 22:34:42 +03:00
DISTRO_PORTING docs: add --with-support-url= to distribution porting guide. (#4035) 2016-08-24 20:49:53 +02:00
HACKING documentation: add a short document describing how to test your systemd build tree (#3763) 2016-07-20 22:15:54 -04:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile-man.am core: add "invocation ID" concept to service manager 2016-10-07 20:14:38 +02:00
Makefile.am build-sys: use non-breaking spaces in contributor list 2016-10-03 07:36:59 -04:00
NEWS units: systemd-udevd: add AF_INET and AF_INET6 to RestrictAddressFamilies= (#4296) 2016-10-06 15:40:53 +02:00
README seccomp: add support for the s390 architecture (#4287) 2016-10-05 13:58:55 +02:00
README.md documentation: add a short document describing how to test your systemd build tree (#3763) 2016-07-20 22:15:54 -04:00
TODO update TODO 2016-10-06 17:27:23 +02:00
autogen.sh Ensure kdbus isn't used (#3501) 2016-06-18 17:24:23 -04:00
configure.ac seccomp: add support for the s390 architecture (#4287) 2016-10-05 13:58:55 +02:00
mkosi.build mkosi: drop git clean 2016-10-06 11:54:24 -04:00
mkosi.default mkosi: create .mkosi directory 2016-10-06 11:53:58 -04:00

README.md

systemd - System and Service Manager

Build Status
Coverity Scan Status

Details

General information about systemd can be found in the systemd Wiki.

Information about build requirements are provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the HACKING file for information how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.