Impact of not having "dbus.mainloop.pyqt6"
Hi, what is the impact for BIT if "dbus.mainloop.pyqt6" is not available? It is imported in "qt/serviceHelper.py". It seems that BIT still starts. Is the service helper related to systray notifications? Kind Christian
On Sat, 2024-03-09 at 08:10 +0000, c.buhtz@posteo.jp wrote:
what is the impact for BIT if "dbus.mainloop.pyqt6" is not available?
It is imported in "qt/serviceHelper.py". It seems that BIT still starts. Is the service helper related to systray notifications?
The serviceHelper.py is not related to the systray icon at all (there is no import for that in the code). It is our dbus service permanently running to support udev rules manipulation (after config changes in BiT and also when "backintime check-config" is called). BiT uses the serviceHelper via the "SetupUdev" class (which is a client-side proxy to do the remote calls of the serviceHelper via dbus): https://github.com/bit-team/backintime/blob/c1a50a9ac9d8955af89672b243cdec4c... https://github.com/bit-team/backintime/blob/c1a50a9ac9d8955af89672b243cdec4c... If "dbus.mainloop.pyqt6" is not available the serviceHelper.py will not work (the main loop is kinda "endless loop" of a service process instance that receives and processes events - in our case dbus remote calls to change udev rules). For details see: https://stackoverflow.com/questions/33428804/role-of-mainloops-event-loops-i... We are using qt6 to start a mainloop for dbus since it encapsulates the dbus implemenation details. I just realized that the package "dbus.mainloop.pyqt6" (that should contain the "DBusQtMainLoop" class) is not available to be installed on Ubuntu 22.04 (nor via pip3). > pip3 install python3-dbus.mainloop.pyqt6 Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement python3-dbus.mainloop.pyqt6 (from versions: none) ERROR: No matching distribution found for python3-dbus.mainloop.pyqt6 So we have a problem for some "older" distros ;-) Still I found an existing documentation https://www.riverbankcomputing.com/static/Docs/PyQt6/dbus.html#dbus-mainloop... and there is eg. also a Debian package available for newer versions: https://packages.debian.org/de/sid/python3-dbus.mainloop.pyqt6 I suggest to get rid of our serviceHelper.py not only for complexity reasons but also for security reasons: I see no need to permanently run a dbus service with root-alike permissons... Instead we should use a polkit-alike "ask the user" when saving the BiT config and a udev rule changes is required. I have no idea so far how this is done but it shouldn't be too difficult.
Dear Jürgen, thanks for reply and explaining (again?). I might have asked about that topic in the past. Am 10.03.2024 21:17 schrieb BiT dev:
We are using qt6 to start a mainloop for dbus since it encapsulates the dbus implemenation details.
That technical detail I tried to better understand. Do we need it? Can we workaround it somehow with Threads? I mean DBus itself might not be a bad solution. But do we need this Qt integration?
I just realized that the package "dbus.mainloop.pyqt6" (that should contain the "DBusQtMainLoop" class) is not available to be installed on Ubuntu 22.04 (nor via pip3).
Yeah and that is why I thought about getting rid of that dependency.
I suggest to get rid of our serviceHelper.py not only for complexity reasons but also for security reasons:
I see no need to permanently run a dbus service with root-alike permissons...
My thoughts where in the same direction. But I lack on expertise.
I have no idea so far how this is done but it shouldn't be too difficult.
OK, good to know. Kind Christian
participants (2)
-
BiT dev
-
c.buhtz@posteo.jp