On Sat, 2024-03-09 at 08:10 +0000, c.bu...@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/c1a50a9ac9d8955af89672b243cdec4c7529c80c/common/tools.py#L2258-L2267

https://github.com/bit-team/backintime/blob/c1a50a9ac9d8955af89672b243cdec4c7529c80c/common/config.py#L1694-L1739

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-in-dbus-service

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-pyqt6

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.

_______________________________________________
Bit-dev mailing list -- bit-dev@python.org
To unsubscribe send an email to bit-dev-le...@python.org
https://mail.python.org/mailman3/lists/bit-dev.python.org/
Member address: arch...@mail-archive.com

Reply via email to