Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API to acquire a connection fd from busd with pre-applied bus names & policies #38

Open
zeenix opened this issue Feb 14, 2024 · 0 comments
Labels
systemd Satisfy the needs of systemd

Comments

@zeenix
Copy link
Collaborator

zeenix commented Feb 14, 2024

This is a clone of an issue filed by @poettering on dbus-broker (bus1/dbus-broker#259) 3 years ago. Copy&pasting verbatim:

I'd like to add support for a ".busname" concept in systemd, where people can declare a dbus service name to acquire as unit file, and it would list the full service name plus the matching policy. PID 1 would then parse that, and pass this to dbus-broker via some driver API, and get an fd back that can be used via socket activation.

The would fix a bunch of issues for us:

  1. Solve the reordering mess when bus names are acquired that already have queued messages
  2. Fixes issues with exit-on-idle: messages would remain enqueued on the bus connection while the service goes down, and it may continue where it left of — except if half-read messages remain
  3. provide compatibility with the DynamicUser= concept of PID 1, as well as the "portable service" concept, as policy could be attached to the unit file itself

I'd suggest to drop the SASL and feature negotiation phase for sockets of this kind, i.e. sockets come readily set up for the main protocol of D-Bus. feature negotiation would have to take place in the unit files too, I guess.

Idea: dbus-broker's driver service would gain:

RegisterActivationService("sauaubas") → "has"

input:

 s → name to acquire
 au → list of uids that shall get access to this service
 au → list of gids that shall get access to this service
 b → boolean that decides if anyone else gets access
 as → feature flags requested ("unix-fd", …)

output:

  h → file handle of connection
  as → agreed on feature flags ("unix-fd", …), subset of same array of input

@poettering Can you please confirm this will be useful still, with a 👍 reaction?

@zeenix zeenix changed the title API to acquire a connection fd from dbus-broker with pre-applied bus names and policies API to acquire a connection fd from busd with pre-applied bus names & policies Apr 29, 2024
@zeenix zeenix added the systemd Satisfy the needs of systemd label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
systemd Satisfy the needs of systemd
Projects
None yet
Development

No branches or pull requests

1 participant