-
Notifications
You must be signed in to change notification settings - Fork 84
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
Support restarting dbus-broker #93
Comments
I discussed this with @thom311 at devconf as well. Nice to see it's being considered. |
Just for completeness: I can see why this is handy. At the same time, this is a non-trivial extension. In dbus-broker, we never access outside resources. The entire daemon is self-contained and fully controlled by its launcher. This makes restarting it easy (if you solve the serialization/deserialization part, which itself is a bigger effort). However, the outer part troubles me. The launcher we provide mirrors the behavior of dbus-daemon regarding configuration parsing, reloading, activation, etc. There might be circular dependencies there (like dbus-broker depending on systemd, and vice-versa), and it is not clear how such a system can be restarted in a safe way. Sure, you can just make them restart in parallel, and it will work most of the time. However, this is something I don't like being involved in. Distribution right now don't provide safe live-updated, and I feel a bit hesitant joining this unsafe area. Long story short: Making dbus-broker restartable should be easy (in the sense of possible problems), but rather a bigger effort. Regarding the launcher, it is easy and less effort, but we would really have to mark this as "you're on your on there", if you restart across non-bugfix releases. While it will be consistent in itself, we can never guarantee consistency with outside dependencies, unless they provide a consistent restart-behavior. |
An old discussion was here: https://wiki.ubuntu.com/DbusRestart Occasionally this issue still pops up. Usually it pops up on the client-side, like "why does NetworkManager not reconnect to the bus when restarting As @dvdhrm says, probably the broker could support it, if somebody implements it. But there also seems not enough necessity/interest for anybody to step up (which is fine)... |
Restarting However, not having to do that would be amazing, of course. |
Check if any services need to be restarted after updating and offers to do so (if there are). The listing of the services is done via `checkservices` from [archlinux/contrib](https://github.com/archlinux/contrib) (available in the [extra] [archlinux-contrib](https://archlinux.org/packages/extra/any/archlinux-contrib/) package). The `dbus-broker.service` and `systemd-logind.service` services are purposely excluded from the listing as they are known for creating issues on restart (see bus1/dbus-broker#93 & https://askubuntu.com/questions/1057028/ubuntu-18-04-freezes-when-running-systemctl-restart-systemd-logind-service) Close #181
…ges upgrade (#203) Check if any services need to be restarted after updating and offers to do so (if there are). The listing of the services is done via `checkservices` from [archlinux/contrib](https://github.com/archlinux/contrib) (available in the [extra] [archlinux-contrib](https://archlinux.org/packages/extra/any/archlinux-contrib/) package). **Important notes:** - The services that may need a post upgrade restart are only checked if an actual package(s) upgrade has been performed by `arch-update` beforehand. This is because the listing of services via `checkservices` requires elevated privileges (as it needs to run `systemctl daemon reload/reexec`), and it would be unexpected to ask for a `sudo/doas/run0` password **everytime** arch-update is executed (even if there's no update available). Checking for this only if an actual package(s) upgrade has been performed beforehand means we already have elevated privileges (as this is required for the package update itself anyway), and such needs for post upgrade service restarts are triggered on package(s) updates anyway, so it kinda makes sense only checking at that moment. - The `dbus-broker.service` and `systemd-logind.service` services are purposely excluded from the listing as they are known for creating issues on restart (see bus1/dbus-broker#93 & https://askubuntu.com/questions/1057028/ubuntu-18-04-freezes-when-running-systemctl-restart-systemd-logind-service) - Most well-known [display managers](https://wiki.archlinux.org/title/Display_manager#List_of_display_managers) services are also excluded as restarting a display manager would cause your current session to close/terminate, which would be unexpected (that doesn't involve display managers from the AUR though). Close #181
Filing this to summarize our in-person conversations during DevConf and track any required work. Please let me know if I got anything wrong.
Currently restarting dbus-broker disconnects all clients from the bus. This mimics dbus-daemon behavior, and in fact dbus-daemon upstream recommends never restarting the daemon and rebooting the system instead. This is problematic for server deployments where reboots can be expensive, especially in case one needs to widely roll out a security update quickly. The scenarios are:
One way to handle this could be the "zero-downtime restart" approach where the old process forks off the new one, then stops accepting new connections and self terminates when it's done handling in-flight ones (nginx or haproxy are examples of this), using
sd_notify
to make systemd aware of the change; however, due to the nature of dbus this can potentially take an unbounded amount of time, so it may not be feasible in practice.The text was updated successfully, but these errors were encountered: