bus1 / dbus-broker

Linux D-Bus Message Broker
https://github.com/bus1/dbus-broker/wiki
Apache License 2.0
675 stars 78 forks source link

Support for other init systems (s6 and runit) #256

Closed shoober420 closed 3 years ago

shoober420 commented 3 years ago

Is it possible to support other init systems besides systemd?

teg commented 3 years ago

Yes. dbus-broker itself is init-system agnostic. You would, however, have to reimplement dbus-broker-launch to integrate with the init system you want. That should be fairly straight forward to do, and the interface is stable, so that could easily be done in a separate project. There are no plans for adding this to the dbus-broker project itself though.

shoober420 commented 3 years ago

When you say reimplemented, do you mean using for example in regards to s6:

dbus-broker-launch.run (start program) dbus-broker-launch.type (longshot) dbus-broker-launch.finish (other commands)

We have translated a .service file before for another program Ananicy.

https://github.com/Nefelim4ag/Ananicy/blob/master/ananicy.service

We added the commands in the systemd .service file to the s6 .run, .type, and .finish files.

https://aur.archlinux.org/cgit/aur.git/tree/?h=ananicy-s6

I noticed the .service file is more advanced, and was wondering if you could help me organize the systemd .service file commands into the s6 file equivalents.

https://github.com/bus1/dbus-broker/blob/main/src/units/system/dbus-broker.service.in

https://github.com/bus1/dbus-broker/blob/main/src/units/user/dbus-broker.service.in

teg commented 3 years ago

I'm afraid it is a bit more complicated than that. The launcher is responsible for not only launching the broker, but also to launch other services that are dbus activated when the broker notifies it. This is currently done by calling into systemd to have that launch and manage the services. If you don't have systemd on your system you'll need to launch these services in some other way. Which would mean reimplementing the launcher binary.

dvdhrm commented 3 years ago

I will be closing this, because we do not intend to work on an alternative launcher. We explicitly split the launcher from the bus implementation, so others can re-use the core bus broker. The API of the broker is documented in the dbus-broker.1 man-page. However, please note that you do need to write a considerable amount of code to write a replacement launcher and integrate the broker into your alternative system.

If you have a particular question regarding implementing a launcher, please feel free to contact us with further questions! But we do not intend to work on such replacements ourself. Thanks!