#3480 Issue closed: Do we actually need dbus in the rescue environment?

Labels: enhancement

lzaoral opened issue at 2025-06-16 13:18:

Currently, ReaR only supports the reference implementation of dbus since commit https://github.com/rear/rear/commit/d82a9553cda33ad89053a00e801d157e0de080d9. Note that the commit message does not mention "why" is was actually added because the "Fedora dbus service required for better debugging systemd" rationale makes no sense to me.

Fedora 29+, RHEL 9+ and possibly other distributions have switched to dbus-broker instead (a more-performant replacement for the reference implementation) which ReaR does not support.

So far, I have not seen any issues with the restore on such systems, with the exception of the following harmless (but rather annoying!) log messages during the installation of GRUB2 on x86 BIOS and ppc64le PowerVM machines:

Installing GRUB2 boot loader...
         Starting dbus.service - D-Bus System Message Bus...
[FAILED] Failed to start dbus.service - D-Bus System Message Bus.
See 'systemctl status dbus.service' for details.
         Starting dbus.service - D-Bus System Message Bus...
[FAILED] Failed to start dbus.service - D-Bus System Message Bus.
See 'systemctl status dbus.service' for details.
         Starting dbus.service - D-Bus System Message Bus...
[FAILED] Failed to start dbus.service - D-Bus System Message Bus.
See 'systemctl status dbus.service' for details.
         Starting dbus.service - D-Bus System Message Bus...
[FAILED] Failed to start dbus.service - D-Bus System Message Bus.
See 'systemctl status dbus.service' for details.
         Starting dbus.service - D-Bus System Message Bus...
[FAILED] Failed to start dbus.service - D-Bus System Message Bus.
See 'systemctl status dbus.service' for details.
[FAILED] Failed to start dbus.service - D-Bus System Message Bus.
See 'systemctl status dbus.service' for details.

# systemctl status dbus.service
× dbus.service - D-Bus System Message Bus
     Loaded: loaded (/usr/lib/systemd/system/dbus.service; static)
     Active: failed (Result: exit-code) since Wed 2024-04-03 14:02:23 EDT; 1min>TriggeredBy: × dbus.socket
    Process: 10983 ExecStartPre=/bin/dbus-uuidgen --ensure (code=exited, status>        CPU: 6ms

Describe the solution you'd like

I'd like to discuss whether we actually need dbus support in the ReaR rescue environment. If not, I suggest to just remove everything dbus-related from the repository. Otherwise, the support for dbus-broker should be implemented.

jsmeix commented at 2025-06-16 14:19:

@lzaoral
a totally offhanded and untested question:
Installing GRUB2 boot loader... happens in
usr/share/rear/finalize/Linux-i386/660_install_grub2.sh
where 'grub[2]-install' is run within chroot $TARGET_FS_ROOT
so I am wondering if Starting dbus.service and the
subsequent Failed to start dbus.service happens
within the ReaR recovery system or
within the restored target system?

lzaoral commented at 2025-06-16 14:44:

I am wondering if Starting dbus.service and the subsequent Failed to start dbus.service happens within the ReaR recovery system or within the restored target system?

@jsmeix Both, to be honest. grub2-install is executed in the restored system using chroot. GRUB2 installer executes os-prober at some point, which executes some other commands which subsequently trigger the dbus.socket because /run is bind-mounted in that chroot. Therefore, systemd in the recovery system will try to start the dbus.service (which then fails on Fedora because dbus-broker is an incompatible implementation).

I have experimented a bit with dbus-monitor and os-prober on a regular Fedora 42 machine and it seems that the triggering messages are just harmless signals from systemd about added/removed and (un)mounted block devices. Mounting of various block devices is in implementation detail of os-prober.

(@pcahyna, please, correct me if I'm wrong.)

jsmeix commented at 2025-06-16 14:58:

@lzaoral
thank you for your explanation.
Now I understand that "it is complicated".

lzaoral commented at 2025-08-19 14:36:

@gdha I know that d82a9553cda33ad89053a00e801d157e0de080d9 was authored in distant past but don't you happen to remember why was the dependency on dbus added? If you don't, I'll go ahead and prepare a PR which removes it.

gdha commented at 2025-08-19 15:57:

@lzaoral As the comment of 2012 mentioned "Fedora dbus service required for better debugging systemd adding the required symlinks to start the dbus service"
If you think it is obsolete these days be my guest and get rid of it.

lzaoral commented at 2025-08-25 11:39:

@gdha I'm still not sure how dbus can be useful for systemd debugging unless dbus-monitor(1) gets copied to rescue (which is not happening now). Fortunately, it was easier than I expected to add support for dbus-broker to ReaR: https://github.com/rear/rear/pull/3515


[Export of Github issue for rear/rear.]