summaryrefslogtreecommitdiff
path: root/src/libsystemd
AgeCommit message (Collapse)Author
2017-05-20Fix it using /usr/include/systemd instead of src/libsystemd/include/systemdLuke Shumaker
To avoid a cyclic dependency thing, `sd-id128.h` has been split in to `sd-id128{,-static}.h`.
2017-05-10amLuke Shumaker
2017-02-01Add a GNUmakefile to apply the MAKEFLAGS we want.Luke Shumaker
2016-12-24Fix an inaccurate comment in sd-daemon.cLuke Shumaker
2016-12-24Fix a grammatical issue in sd_notify(3).Luke Shumaker
2016-12-17move local-addresses.{c,h} libsystemd-{internal/sd-netlink,shared}Luke Shumaker
2016-12-17Merge branch 'notsystemd/postmove' into notsystemd/masterLuke Shumaker
# Conflicts: # src/grp-journal/libjournal-core/.gitignore # src/grp-system/libcore/include/core/mount.h
2016-12-17./tools/notsd-moveLuke Shumaker
2016-11-03Revert "sd-bus: use PRIu64 instead of casting" (#4556)systemd/v232Zbigniew Jędrzejewski-Szmek
This reverts commit 75ead2b753cb9586f3f208326446081baab70da1. Follow up for #4546: > @@ -848,8 +848,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { if (k->src_id == KDBUS_SRC_ID_KERNEL) bus_message_set_sender_driver(bus, m); else { - xsprintf(m->sender_buffer, ":1.%llu", - (unsigned long long)k->src_id); + xsprintf(m->sender_buffer, ":1.%"PRIu64, k->src_id); This produces: src/libsystemd/sd-bus/bus-kernel.c: In function ‘bus_kernel_make_message’: src/libsystemd/sd-bus/bus-kernel.c:851:44: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘__u64 {aka long long unsigned int}’ [-Wformat=] xsprintf(m->sender_buffer, ":1.%"PRIu64, k->src_id); ^
2016-11-02sd-bus: use PRIu64 instead of castingZbigniew Jędrzejewski-Szmek
2016-10-27Merge branch 'notsystemd/postmove' into notsystemd/masterLuke Shumaker
# Conflicts: # src/grp-resolve/systemd-resolved/Makefile # src/libsystemd/Makefile # src/libsystemd/src/Makefile
2016-10-27./tools/notsd-moveLuke Shumaker
2016-10-27`git diff`-guided cleanupLuke Shumaker
2016-10-21wipLuke Shumaker
2016-10-16tree-wide: use mfree moreZbigniew Jędrzejewski-Szmek
2016-10-13Merge pull request #653 from dvdhrm/bus-goldZbigniew Jędrzejewski-Szmek
2016-10-07core: add "invocation ID" concept to service managerLennart Poettering
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-06sd-bus: add DNS errors to the errno translation tableLennart Poettering
We generate these, hence we should also add errno translations for them.
2016-10-06sd-bus: add a few missing entries to the error translation tablesLennart Poettering
These were forgotten, let's add some useful mappings for all errors we define.
2016-10-06sd-device/networkd: unify code to get a socket for issuing netdev ioctls onLennart Poettering
As suggested here: https://github.com/systemd/systemd/pull/4296#issuecomment-251911349 Let's try AF_INET first as socket, but let's fall back to AF_NETLINK, so that we can use a protocol-independent socket here if possible. This has the benefit that our code will still work even if AF_INET/AF_INET6 is made unavailable (for exmple via seccomp), at least on current kernels.
2016-10-06Merge pull request #4199 from dvdhrm/hwdb-orderLennart Poettering
hwdb: return conflicts in a well-defined order
2016-09-26test-bus-creds: are more debugging infoZbigniew Jędrzejewski-Szmek
This test sometimes fails in semaphore, but not when run interactively, so it's hard to debug.
2016-09-24systemctl,networkctl,busctl,backlight: use STRPTR_IN_SETZbigniew Jędrzejewski-Szmek
2016-09-21sd-hwdb: order properties by originDavid Herrmann
If we find duplicates in a property-lookup, make sure to order them by their origin. That is, matches defined "later" take precedence over earlier matches. The "later"-order is defined by file-name + line-number combination. That is, if a match is defined below another one in the same hwdb file, it takes precedence, same as if it is defined in a file ordered after another one. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2016-09-21hwdb: store file-name and file-number with propertiesDavid Herrmann
Extend the hwdb to store the source file-name and file-number for each property. We simply extend the stored value struct with the new information. It is fully backwards compatible and old readers will continue to work. The libudev/sd-hwdb reader is updated in a followup. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2016-09-21sd-hwdb: fix child/value offset calculationDavid Herrmann
It is not legal to use hard-coded types to calculate offsets. We must always use the offsets of the hwdb header to calculate those. Otherwise, we will break horribly if run on hwdb files written by other implementations or written with future extensions. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2016-09-15Merge branch 'notsystemd/postmove' into notsystemd/masterLuke Shumaker
# Conflicts: # build-aux/Makefile.each.tail/50-sd.mk # build-aux/Makefile.each.tail/70-man.mk # src/grp-resolve/libbasic-dns/Makefile # src/grp-system/libcore/Makefile # tools/notsd-move
2016-09-15./tools/notsd-moveLuke Shumaker
2016-09-14Merge branch 'notsystemd/postmove' into notsystemd/masterLuke Shumaker
# Conflicts: # src/grp-journal/systemd-journald/Makefile # src/grp-login/systemd-logind/Makefile # src/grp-machine/grp-import/systemd-export/Makefile # src/grp-machine/grp-import/systemd-import/Makefile # src/grp-machine/grp-import/systemd-pull/Makefile # src/grp-machine/systemd-machined/Makefile # src/grp-network/libnetworkd-core/Makefile # src/grp-resolve/libbasic-dns/Makefile # src/grp-resolve/systemd-resolved/Makefile # src/grp-utils/systemd-path/Makefile # src/libshared/src/Makefile # src/libsystemd-network/include/systemd-network/sd-ndisc.h # src/libsystemd/Makefile # src/libsystemd/src/test.mk # src/libudev/Makefile # src/systemd-dbus1-generator/Makefile # src/systemd-nspawn/nspawn.c Signed-off-by: Luke Shumaker <lukeshu@sbcglobal.net>
2016-09-14networkd: add support to configure virtual CAN device (#4139)Susant Sahani
1. add support for kind vcan 2. fixup indention netlink-types.c, networkd-netdev.c
2016-09-13./tools/notsd-moveLuke Shumaker
2016-09-13tests: get rid of strerrorZbigniew Jędrzejewski-Szmek
2016-09-12./tools/notsd-fixup **/MakefileLuke Shumaker
2016-09-11Run the new fixup script.Luke Shumaker
The biggest change is that it keeps looking for new #include blocks. This means that it (more) correctly handles #ifdef'd #includes. I'm not 100% in love with it, but it's pretty good for automated. What I really don't like is it did some silly things with newlines in typedef blocks. I've avoided committing those. I think it may be possible to get it to do the right thing. But really, the typedef blocks are a hack for poorly structured headers. Now that it keeps looking for new #include blocks, I could strip out the typedef support, and it would mostly work; but it wouldn't be able to move some headers back to the top. IDK what to do.
2016-09-06clean up file locations a bitLuke Shumaker
2016-09-06move man pages to appropriate directoriesLuke Shumaker
2016-08-31sd-bus: bump message queue sizeLennart Poettering
Let's bump it further, as this the current limit turns out to be problematic IRL. Let's bump it to more than twice what we know of is needed. Fixes: #4068
2016-08-22sd-bus: optionally, exit process or event loop on disconnectLennart Poettering
Old libdbus has a feature that the process is terminated whenever the the bus connection receives a disconnect. This is pretty useful on desktop apps (where a disconnect indicates session termination), as well as on command line apps (where we really shouldn't stay hanging in most cases if dbus daemon goes down). Add a similar feature to sd-bus, but make it opt-in rather than opt-out, like it is on libdbus. Also, if the bus is attached to an event loop just exit the event loop rather than the the whole process.
2016-08-22sd-bus: add a small test case for sd_bus_trackLennart Poettering
This tests in particular that disconnecting results in the tracking object's handlers to be called.
2016-08-22sd-bus: when the server-side disconnects, make sure to dispatch all tracking ↵Lennart Poettering
objects immediately If the server side kicks us from the bus, from our view no names are on the bus anymore, hence let's make sure to dispatch all tracking objects immediately.
2016-08-22sd-bus: ensure we don't dispatch track objects while we are adding names to themLennart Poettering
In order to add a name to a bus tracking object we need to do some bus operations: we need to check if the name already exists and add match for it. Both are synchronous bus calls. While processing those we need to make sure that the tracking object is not dispatched yet, as it might still be empty, but is not going to be empty for very long. hence, block dispatching by removing the object from the dispatch queue while adding it, and readding it on error.
2016-08-22sd-bus: split out handling of reply callbacks on close into its own functionLennart Poettering
When a bus connection is closed we dispatch all reply callbacks. Do so in a new function if its own. No behaviour changes.
2016-08-22core: add Ref()/Unref() bus calls for unitsLennart Poettering
This adds two (privileged) bus calls Ref() and Unref() to the Unit interface. The two calls may be used by clients to pin a unit into memory, so that various runtime properties aren't flushed out by the automatic GC. This is necessary to permit clients to race-freely acquire runtime results (such as process exit status/code or accumulated CPU time) on successful service termination. Ref() and Unref() are fully recursive, hence act like the usual reference counting concept in C. Taking a reference is a privileged operation, as this allows pinning units into memory which consumes resources. Transient units may also gain a reference at the time of creation, via the new AddRef property (that is only defined for transient units at the time of creation).
2016-08-22sd-bus: add a "recursive" mode to sd_bus_trackLennart Poettering
This adds an optional "recursive" counting mode to sd_bus_track. If enabled adding the same name multiple times to an sd_bus_track object is counted individually, so that it also has to be removed the same number of times before it is gone again from the tracking object. This functionality is useful for implementing local ref counted objects that peers make take references on.
2016-08-17moreLuke Shumaker
2016-08-15core: rename cg_unified() to cg_all_unified()Tejun Heo
A following patch will update cgroup handling so that the systemd controller (/sys/fs/cgroup/systemd) can use the unified hierarchy even if the kernel resource controllers are on the legacy hierarchies. This would require distinguishing whether all controllers are on cgroup v2 or only the systemd controller is. In preparation, this patch renames cg_unified() to cg_all_unified(). This patch doesn't cause any functional changes.
2016-08-10fix build systemLuke Shumaker
2016-08-08fixLuke Shumaker
2016-08-02ensure that include order of headers does not matterLuke Shumaker
2016-08-02fixLuke Shumaker