Systemd/src/network
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
..
.gitignore Add networkd-gperf.c to gitignore 2016-04-02 11:52:57 -04:00
Makefile networkd: add a basic network daemon 2013-11-09 23:41:17 +01:00
networkctl.c systemctl,networkctl,busctl,backlight: use STRPTR_IN_SET 2016-09-24 20:22:05 -04:00
networkd-address-pool.c network: check return value 2016-04-08 21:08:02 -04:00
networkd-address-pool.h networkd: rework headers to avoid circular includes 2016-04-29 19:01:28 -04:00
networkd-address.c networkd: constify more things 2016-06-03 19:54:35 +02:00
networkd-address.h networkd: constify more things 2016-06-03 19:54:35 +02:00
networkd-brvlan.c networkd: apply bridge vlan configuration correct 2016-08-04 17:14:18 +02:00
networkd-brvlan.h networkd: apply bridge vlan configuration correct 2016-08-04 17:14:18 +02:00
networkd-conf.c tree-wide: rename config_parse_many to …_nulstr 2016-09-16 10:32:03 -04:00
networkd-conf.h networkd: rework duid_{type,duid_type,duid,duid_len} setting 2016-05-03 12:23:01 -04:00
networkd-dhcp4.c networkd: Allow specifying RouteTable for DHCP 2016-09-19 03:27:42 +00:00
networkd-dhcp6.c network: beef up ipv6 RA support considerably 2016-06-06 20:11:38 +02:00
networkd-fdb.c networkd: use BridgeFDB as well on bridge ports (#4253) 2016-10-05 17:06:40 +02:00
networkd-fdb.h networkd: drop weird "const" usage in function parameters 2016-06-03 19:20:46 +02:00
networkd-gperf.gperf networkd: rework duid_{type,duid_type,duid,duid_len} setting 2016-05-03 12:23:01 -04:00
networkd-ipv4ll.c tree-wide: htonl() is weird, let's use htobe32() instead (#3538) 2016-06-15 01:26:01 +02:00
networkd-link-bus.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-link.c networkd: fix coding style (#4294) 2016-10-06 11:45:07 +02:00
networkd-link.h core: add "invocation ID" concept to service manager 2016-10-07 20:14:38 +02:00
networkd-lldp-tx.c networkd: reworkd LLDP emission to allow control of propagation level 2016-05-09 15:45:31 +02:00
networkd-lldp-tx.h networkd: reworkd LLDP emission to allow control of propagation level 2016-05-09 15:45:31 +02:00
networkd-manager-bus.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-manager.c networkd: drop route_drop 2016-05-14 16:46:01 -04:00
networkd-ndisc.c networkd: Allow specifying RouteTable for RAs 2016-09-19 03:27:46 +00:00
networkd-ndisc.h network: beef up ipv6 RA support considerably 2016-06-06 20:11:38 +02:00
networkd-netdev-bond.c networkd: rework headers to avoid circular includes 2016-04-29 19:01:28 -04:00
networkd-netdev-bond.h networkd: rework headers to avoid circular includes 2016-04-29 19:01:28 -04:00
networkd-netdev-bridge.c networkd: fix "parametres" typo (#4244) 2016-09-30 13:25:25 +02:00
networkd-netdev-bridge.h networkd: add options to bridge (#4051) 2016-08-31 20:06:23 +02:00
networkd-netdev-dummy.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-netdev-dummy.h networkd: rework headers to avoid circular includes 2016-04-29 19:01:28 -04:00
networkd-netdev-gperf.gperf networkd: remote checksum offload for vxlan (#4110) 2016-10-07 09:46:18 -04:00
networkd-netdev-ipvlan.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-netdev-ipvlan.h networkd: rework headers to avoid circular includes 2016-04-29 19:01:28 -04:00
networkd-netdev-macvlan.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-netdev-macvlan.h networkd: rework headers to avoid circular includes 2016-04-29 19:01:28 -04:00
networkd-netdev-tunnel.c tree-wide: htonl() is weird, let's use htobe32() instead (#3538) 2016-06-15 01:26:01 +02:00
networkd-netdev-tunnel.h networkd: Tunnel add support to configure key for VTI/VTI6 (#3532) 2016-06-14 19:11:57 +02:00
networkd-netdev-tuntap.c networkd: rework headers to avoid circular includes 2016-04-29 19:01:28 -04:00
networkd-netdev-tuntap.h networkd: rework headers to avoid circular includes 2016-04-29 19:01:28 -04:00
networkd-netdev-vcan.c networkd: add support to configure virtual CAN device (#4139) 2016-09-14 18:15:16 +02:00
networkd-netdev-vcan.h networkd: add support to configure virtual CAN device (#4139) 2016-09-14 18:15:16 +02:00
networkd-netdev-veth.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-netdev-veth.h networkd: rework headers to avoid circular includes 2016-04-29 19:01:28 -04:00
networkd-netdev-vlan.c networkd: clean up vlan handling a bit (#3478) 2016-06-09 18:55:16 +02:00
networkd-netdev-vlan.h networkd: clean up vlan handling a bit (#3478) 2016-06-09 18:55:16 +02:00
networkd-netdev-vrf.c networkd: vrf: add support for enslaving devices to VRFs 2016-06-16 00:25:06 +02:00
networkd-netdev-vrf.h networkd: added support for vrf interfaces (#3316) 2016-06-16 00:25:06 +02:00
networkd-netdev-vxlan.c networkd: remote checksum offload for vxlan (#4110) 2016-10-07 09:46:18 -04:00
networkd-netdev-vxlan.h networkd: remote checksum offload for vxlan (#4110) 2016-10-07 09:46:18 -04:00
networkd-netdev.c Merge pull request #4123 from keszybz/network-file-dropins 2016-09-17 10:00:19 +02:00
networkd-netdev.h core: add "invocation ID" concept to service manager 2016-10-07 20:14:38 +02:00
networkd-network-bus.c networkd: fix dbus matchmac interface (#3485) 2016-06-10 12:35:43 +02:00
networkd-network-gperf.gperf networkd: Allow specifying RouteTable for RAs 2016-09-19 03:27:46 +00:00
networkd-network.c networkd: Allow specifying RouteTable for RAs 2016-09-19 03:27:46 +00:00
networkd-network.h networkd: Allow specifying RouteTable for RAs 2016-09-19 03:27:46 +00:00
networkd-route.c networkd: limit the number of routes to the kernel limit (#4007) 2016-08-21 15:06:28 +02:00
networkd-route.h networkd: constify more things 2016-06-03 19:54:35 +02:00
networkd-util.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-util.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-wait-online-link.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-wait-online-link.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
networkd-wait-online-manager.c networkd: use strv_fnmatch() (#3605) 2016-06-26 17:37:24 +02:00
networkd-wait-online.c util: introduce common version() implementation and use it everywhere 2015-09-29 21:08:37 +02:00
networkd-wait-online.h tree-wide: place #pragma once at the same place everywhere 2016-02-20 22:42:29 +01:00
networkd.c DHCP DUID, IAID configuration options 2016-03-30 16:33:55 -07:00
networkd.h networkd: add support to configure virtual CAN device (#4139) 2016-09-14 18:15:16 +02:00
org.freedesktop.network1.conf networkd: add basic dbus API 2015-02-05 11:50:34 +01:00
org.freedesktop.network1.service networkd: add basic dbus API 2015-02-05 11:50:34 +01:00
test-network-tables.c tree-wide: use mdash instead of a two minuses 2016-04-21 23:00:13 -04:00
test-network.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-networkd-conf.c network: test MAC address parsing 2016-05-17 16:55:20 -04:00