summaryrefslogtreecommitdiff
path: root/src/systemd/sd-bus.h
Commit message (Collapse)AuthorAge
* sd-bus: add new sd_bus_slot_set_floating() callLennart Poettering2018-08-24
| | | | | | | | | | This new call allows explicit control of the "floating" state of a bus slot object. This is useful for creating a bus slot object first, retaining a reference to it, using it for making changes to the slot object (for example, set a description) and then handing it over to sd-bus for lifecycle management. It's also useful to fix #8551.
* sd-bus: allow description to be set for system/user busses (#8594)Zbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | | | sd_bus_open/sd_bus_open_system/sd_bus_open_user are convenient, but don't allow the description to be set. After they return, the bus is is already started, and sd_bus_set_description() fails with -EBUSY. It would be possible to allow sd_bus_set_description() to update the description "live", but messages are already emitted from sd_bus_open functions, so it's better to allow the description to be set in sd_bus_open/sd_bus_open_system/sd_bus_open_user. Fixes message like: Bus n/a: changing state UNSET → OPENING
* core: don't process dbus unit and job queue when there are already too many ↵Lennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | messages pending We maintain a queue of units and jobs that we are supposed to generate change/new notifications for because they were either just created or some of their property has changed. Let's throttle processing of this queue a bit: as soon as > 1K of bus messages are queued for writing let's skip processing the queue, and then recheck on the next iteration again. Moreover, never process more than 100 units in one go, return to the event loop after that. Both limits together should put effective limits on both space and time usage of the function, delaying further operations until a later moment, when the queue is empty or the the event loop is sufficiently idle again. This should keep the number of generated messages much lower than before on busy systems or where some client is hanging. Note that this also means a bad client can slow down message dispatching substantially for up to 90s if it likes to, for all clients. But that should be acceptable as we only allow trusted bus clients, anyway. Fixes: #8166
* Add support for SD_BUS_DEFAULT*Nathaniel McCallum2018-05-30
| | | | | | | | | | | | | | | | | | | | | | Currently, sd-bus supports the ability to have thread-local default busses. However, this is less useful than it can be since all functions which require an sd_bus* as input require the caller to pass it. This patch adds a new macro which allows the developer to pass a constant SD_BUS_DEFAULT, SD_BUS_DEFAULT_USER or SD_BUS_DEFAULT_SYSTEM instead. This reduces work for the caller. For example: r = sd_bus_default(&bus); r = sd_bus_call_method(bus, ...); sd_bus_unref(bus); Becomes: r = sd_bus_call_method(SD_BUS_DEFAULT, ...); If the specified thread-local default bus does not exist, the function calls will return -ENOPKG. No bus will ever be implicitly created.
* sd-bus: add API to optionally set a sender field on all outgoing messagesLennart Poettering2018-05-30
| | | | | | | | | | This is useful on direct connections to generate messages with valid sender fields. This is particularly useful for services that are accessible both through direct connections and the broker, as it allows clients to install matches on the sender service name, and they work the same in both cases.
* networkd,resolved: make use of watch_bind feature to connect to the busLennart Poettering2018-05-30
| | | | | | | | | | The changes both networkd and resolved to make use of the watch_bind feature of sd-bus to connect to the system bus. This way, both daemons can be started during early boot, and automatically and instantly connect to the system bus as it becomes available. This replaces prior code that used a time-based retry logic to connect to the bus.
* sd-bus: add new sd_bus_is_ready() APILennart Poettering2018-05-30
| | | | | | | | This new call is much light sd_bus_is_open(), but returns true only if the connection is fully set up, i.e. after we finished with the authentication and Hello() phase. This API is useful for clients in particular when using the "watch_bind" feature, as that way it can be determined in advance whether it makes sense to sync on some operation.
* sd-bus: add new API sd_bus_match_signal() + sd_bus_match_signal_asnyc()Lennart Poettering2018-05-30
| | | | | | These are convenience helpers that hide the match string logic (which we probably should never have exposed), and instead just takes regular C arguments.
* sd-bus: add asynchronous version of sd_bus_match()Lennart Poettering2018-05-30
| | | | | | | We usually enqueue a number of these calls on each service initialization. Let's do this asynchronously, and thus remove synchronization points. This improves both performance behaviour and reduces the chances to deadlock.
* sd-bus: add APIs to request/release names asynchronouslyLennart Poettering2018-05-30
| | | | | | | | | | | They do the same thing as their synchronous counterparts, but only enqueue the operation, thus removing synchronization points during service initialization. If the callback function is passed as NULL we'll fallback to generic implementations of the reply handlers, that terminate the connection if the requested name cannot be acquired, under the assumption that not being able to acquire the name is a technical problem.
* sd-bus: optionally, use inotify to wait for bus sockets to appearLennart Poettering2018-05-30
| | | | | | | | | | | This adds a "watch-bind" feature to sd-bus connections. If set and the AF_UNIX socket we are connecting to doesn't exist yet, we'll establish an inotify watch instead, and wait for the socket to appear. In other words, a missing AF_UNIX just makes connecting slower. This is useful for daemons such as networkd or resolved that shall be able to run during early-boot, before dbus-daemon is up, and want to connect to dbus-daemon as soon as it becomes ready.
* Prep v236 : Add missing SPDX-License-Identifier (7/9) src/systemdSven Eden2018-03-26
|
* Some minor cleanupsSven Eden2018-03-07
|
* Prep 235: Make elogind masks in sd-bus.h c90 compatible again.Sven Eden2018-01-09
|
* Prep 235: Enabled sd_bus_creds_get_slice(), sd_bus_creds_get_user_slice(), ↵Sven Eden2018-01-09
| | | | sd_peer_get_user_slice() and sd_pid_get_user_slice() to try to work with eloginds session id to user mapping.
* sd-bus.h, sd-daemon.h : MAke elogind masks ISO C90 compatible.Sven Eden2017-12-13
|
* Prep v232.6: Make all supportable API functions visibleSven Eden2017-12-12
| | | | (v232 addition).
* Prep 229.9: Make all supportable API functions visible.Sven Eden2017-12-12
| | | | | | | | | | The process of cleaning up elogind, meaning to mask all bits that are unneeded by elogind, has been finished a while ago. It is therefore time to re-enable all previously masked API functions that elogind can support. This will make it easier for future developers to integrate elogind into their software where they already support systemd-login.
* Prep v234: Apply missing upstream fixes in src/systemd (5/6)Sven Eden2017-07-25
|
* Prep v233.3: Unmask various functions for future coverage tests.Sven Eden2017-07-19
| | | | | These functions, although not used by elogind itself, are mostly tiny and crucial for important tests to work.
* Prep v232: Add libelogind.sym entries for version 232.Sven Eden2017-07-05
|
* Prep v232: Apply missing updates from upstreamSven Eden2017-07-05
|
* Prep v230: Add utmp support to make wall message to work properly.Sven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (8/8) src/systemd.Sven Eden2017-06-16
|
* Prep v229: Add missing fixes from upstream [6/6] src/systemdSven Eden2017-05-17
|
* Prep v228: Condense elogind source masks (5/5)Sven Eden2017-04-26
|
* Prep v228: Substitute declaration masks (4/4)Sven Eden2017-04-26
|
* Prep v227: Clean up some headers in src/systemdSven Eden2017-04-09
| | | | | | - src/systemd/sd-bus.h - src/systemd/sd-daemon.h - src/systemd/sd-event.h
* [5/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* Major cleanup of all leftovers after rebasing on master.Sven Eden2017-03-14
| | | | | | | | The patching of elogind in several steps with only partly rebasing on a common commit with upstream, left the tree in a state, that was unmergeable with master. By rebasing on master and manually cleaning up all commits, this merge is now possible. However, this process left some orphans, that are cleanup now.
* Classify processes from sessions into cgroupsSven Eden2017-03-14
| | | | | | | Create a private cgroup tree associated with no controllers, and use it to map PIDs to sessions. Since we use our own path structure, remove internal cgroup-related helpers that interpret the cgroup path structure to pull out users, slices, and scopes.
* Prep v221: Update and clean up build system to sync with upstreamSven Eden2017-03-14
| | | | | | | | | | | | | | 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.
* sd-bus: sd_bus_slot_get_description() should return const stringsDavid Herrmann2017-03-14
| | | | | | | | | | All other *_get_description() functions use 'const char**', so make sure sd_bus_slot_get_description() does the same. This changes API, but ABI stays stable. I think this is fine, but I wouldn't mind bumping SONAME. Reported in #528.
* sd-bus: introduce new sd_bus_flush_close_unref() callLennart Poettering2017-03-14
| | | | | | | | | | | | | | | | sd_bus_flush_close_unref() is a call that simply combines sd_bus_flush() (which writes all unwritten messages out) + sd_bus_close() (which terminates the connection, releasing all unread messages) + sd_bus_unref() (which frees the connection). The combination of this call is used pretty frequently in systemd tools right before exiting, and should also be relevant for most external clients, and is hence useful to cover in a call of its own. Previously the combination of the three calls was already done in the _cleanup_bus_close_unref_ macro, but this was only available internally. Also see #327
* sd-bus: add async convenience method call APIUmut Tezduyar Lindskog2017-03-14
|
* sd-bus,sd-event: make public APIsLennart Poettering2017-03-14
| | | | | | With the v221 release these APIs should be public, stable APIs, hence let's install their headers by default now, and add their symbols to the .sym file.
* sd-bus,sd-login: add api for querying the slice within the the user systemd ↵Lennart Poettering2017-03-14
| | | | | | | instance of a process units are organized in slice trees, not only for the system instance, but also for user systemd instances, expose this properly.
* sd-bus: drop bus parameter from message callback prototypeLennart Poettering2017-03-14
| | | | | | This should simplify the prototype a bit. The bus parameter is redundant in most cases, and in the few where it matters it can be derived from the message via sd_bus_message_get_bus().
* sd-bus: add controlling tty field to sd_creds objectLennart Poettering2017-03-14
| | | | | This is useful to print wall messages from logind with the right client tty. (to be added in a later patch)
* sd-bus: expose ppid fieldLennart Poettering2017-03-14
| | | | | kdbus has been passing us the ppid file for a while, actually make use of it.
* sd-bus: when augmenting creds, remember which ones were augmentedLennart Poettering2017-03-14
| | | | | Also, when we do permissions checks using creds, verify that we don't do so based on augmented creds, as extra safety check.
* sd-bus: allow setting a per-connection default value for the ↵Lennart Poettering2015-02-18
| | | | | | | | | "allow-interactive-authentication" message flag Most of our client tools want to set this bit for all their method calls, even though it defaults to off in sd-bus, and rightfully so. Hence, to simplify thing, introduce a per sd_bus-object flag that sets the default value for all messages created on the connection.
* sd-bus: add missing format attributeCristian Rodríguez2015-02-16
|
* sd-bus: export sd_bus_error_set_errnofv()Lennart Poettering2015-02-13
|
* bus: add sd_bus_emit_object_{added/removed}()David Herrmann2014-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | | This implements two new helpers, discussed on systemd-devel about 1 year ago: sd_bus_emit_object_added() sd_bus_emit_object_removed() Both calls are equivalent to their respective counterpart sd_bus_emit_interfaces_{added/removed}(), but can figure out the list of interfaces themselves, instead of requiring the caller to provide them. Furthermore, both calls properly deal with builtin interfaces provided via org.freedesktop.DBus.* and alike. Both calls simply traverse a node and all its parent nodes to figure out a list of all interfaces registered as vtable or fallback. It then appends each of them, similar to the interfaces_{added/removed}() helpers. Note that interfaces_{added/removed}() runs a parent traversal for *each* passed interface. Therefore, it can simply bail out, once it found a parent node that implements a given interface. With object_{added/removed}() we cannot know the registered interfaces in advance, thus, we cannot run one traversal per node. Instead, we run a single traversal and remember all interfaces that we added. Therefore, a child-interface overrides all conflicting parent-interfaces. We keep a "Set *s" context to track those while climbing up the tree.
* sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering2014-12-24
| | | | | | | Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
* sd-bus: get rid of PID starttime conceptLennart Poettering2014-12-09
| | | | As kdbus no longer exports this, remove all traces from sd-bus too
* sd-bus: properly support passing memfds around with offset/size parametersLennart Poettering2014-12-09
|
* sd-bus: rework ELF error mapping table magicLennart Poettering2014-12-08
| | | | | | | The ELF magic cannot work for consumers of our shard library, since they are in a different module. Hence make all the ELF magic private, and instead introduce a public function to register additional static mapping table.
* sd-bus: make more connection properties readableLennart Poettering2014-11-28
|