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

Running dbus-broker-launch without systemd (the reprise) #340

Open
pharcosyle opened this issue Jan 23, 2024 · 6 comments
Open

Running dbus-broker-launch without systemd (the reprise) #340

pharcosyle opened this issue Jan 23, 2024 · 6 comments

Comments

@pharcosyle
Copy link

This has been discussed before (#183, #188). I'd like to run dbus-broker-launch without systemd.

My use case: I'm a Guix user (and developer, a bit) and I'd like to add an alternative option to use dbus-broker instead of dbus. Guix already jumps through some hoops to get dbus working as it uses elogind not systemd (although I use seatd) and I figure as long as we're hacking our way to functional distro dbus support anyway we might as well use a better implementation. I understand that there will be no service activation: that's fine, service activation sort of sucks so I/we already manually run daemons for pretty much everything (GNU Shepherd is nice for this).

I've patched the source so it compiles successfully against elogind. I've also naively updated that years-old PR (see pharcosyle@ec11a6b). I think the only thing I have left to do is create a unix socket that I pass to dbus-broker-launch and manage its lifecycle sensibly but I don't really know how to do that. I'd be grateful if anyone could give me some advice on how to go about completing this task or offer alternatives. Thank you!

@dvdhrm
Copy link
Member

dvdhrm commented Jan 23, 2024

Hi! The test-suite in ./test/dbus/ already creates a dbus-broker instance, which it then runs tests against. The util-broker.c module shows how to create a unix-listener socket and pass it to a new instance of dbus-broker. It also shows how to do that with the reference implementation dbus-daemon.

Also note that at-spi2 (GNOME accessibility) does something similar and spawns its own dbus-broker instance.

There is no need to use dbus-broker-launch if service activation is not desired. Furthermore, if activation is desired, you can use dbus-broker-launch as example how to design a launcher for dbus-broker.

Lastly, you can always stick to dbus-daemon to get a well-maintained solution that does not require systemd.

@pharcosyle
Copy link
Author

Thanks so much, this is good info. I realize as I work on this more I really need to understand DBus and its role in Guix better. This is slower-going than I'd hoped so I'm putting it on the backburner for now, but thank you again!

@nmeum
Copy link

nmeum commented Feb 4, 2024

Hey, perhaps a bit off-topic, but I am also interested in making it easier to run and use dbus-broker on Guix and Alpine (both systems without systemd). Let me know if you come up with a good Guix (home) service for dbus-broker 🙋

@pharcosyle
Copy link
Author

I'll make you a deal: I'll furnish the Guix packages for it and you make the service. Here, I'll do my part now:
dbus-broker-guix.patch.txt

@mid-kid
Copy link

mid-kid commented May 8, 2024

Glad to read that there's still interest in making new software not hard-depend on systemd where it doesn't need to. I'm personally interested in making it work with OpenRC, as I wanted to implement some form of dbus activation in it (instead of letting them run unsupervised). Is there any specific reason why dbus activation is frowned upon in Guix?

@pharcosyle
Copy link
Author

Is there any specific reason why dbus activation is frowned upon in Guix?

It's not. However GNU Shepherd, Guix's service manager / init system, is deeply programmable and really nice and I'd prefer to run all the services on my machine through it rather than automagically with dbus activation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants