Why org.freedesktop.DBus.Local.Disconnected is called?

Thiago Macieira thiago at kde.org
Thu Nov 12 04:32:48 UTC 2020


On Sunday, 8 November 2020 08:16:37 PST Sheng Mao wrote:
> Thank you for explaining this, Thiago!
> 
> Then it means the unregistration code kwin_x11 will not be executed.
> Although I still don’t know who/why terminates the session but it is
> something I can use.

You can debug to find out the order in which events are happening. Does 
kwin_x11 exit before the dbus-daemon exits? Or does the daemon exit first, 
thus causing kwin_x11 to quit?

And is there sufficient time for dbus-daemon to notice other applications' 
exit and send service name deregistration signals? If all the processes are 
terminated too quickly, dbus-daemon may react to its termination before 
handling all the sockets.

> * in kwin_x11, I need to add a watcher for session disconnected, and close
> kwin_x11 event loop on that
> * in startkde, I need to add a timer to query registration status. My test
> app shows that the service becomes unregistered after a few seconds.
> QDBusServiceWatcher cannot send a unregistration event/signal if
> org.kde.KWin is terminated passively.
> 
> Thank you! I will do more tests on that.

You should simply react to the Disconnected signal and handle that as a 
deregistration of every single service name.

Note you can't send anything to D-Bus any more.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering





More information about the dbus mailing list