rpm-software-management / dnf5

Next-generation RPM package management system
Other
223 stars 73 forks source link

Offline transactions should warn when systemd missing #1554

Open evan-goode opened 1 week ago

evan-goode commented 1 week ago

When inside a systemd-less container, system-upgrade download (or any dnf5 <command> --offline command) will proceed without warning, but when dnf5 offline reboot is run, it errors because it cannot connect to D-Bus to trigger a reboot:

Couldn't connect to D-Bus: [org.freedesktop.DBus.Error.FileNotFound] Failed to open bus (No such file or directory)

When systemd is missing, any command setting up an offline transaction should display a warning, ideally one that the user has to manually acknowledge, to indicate that offline transactions do not work in environments without systemd.

Additionally, the error message from dnf5 offline reboot when systemd is missing should mention that the problem is probably that offline transactions do not work without systemd.

A couple testers at https://testdays.fedoraproject.org/events/189 tried testing system-upgrade inside a container and were confused.

evan-goode commented 1 week ago

In certain situations, the D-Bus error may be an AccessDenied rather than a FileNotFound:

[sumantrom@toolbox ~]$ sudo dnf5 system-upgrade reboot
The system will now reboot to upgrade to release version 40. Is this ok [y/N]: y
[org.freedesktop.DBus.Error.AccessDenied] Sender is not authorized to send message

I think in Fedora Toolbox, the container may be able to interact with the host systemd but is not privileged to reboot it.