On logout, the session dbus process is killed.
The default behaviour for libdbus is to exit(1) on bus disconnect, which would
leave the container running in the background with Android bootlooping while
trying to establish a Wayland connection again.
Intercept the disconnect signal and gracefully stop the container instead.
do_stop(self.args, self.looper)
stop_container(quit_session=False)
do_stop(self.args, self.looper)
stop_container(quit_session=False)
+def handle_disconnect(args, looper):
+ do_stop(args, looper)
+ stop_container(quit_session=False)
+
def service(args, looper):
def service(args, looper):
+ bus = dbus.SessionBus()
+ bus.set_exit_on_disconnect(False)
+ bus.add_signal_receiver(lambda: handle_disconnect(args, looper),
+ signal_name='Disconnected',
+ dbus_interface='org.freedesktop.DBus.Local')
dbus_obj = DbusSessionManager(looper, dbus.SessionBus(), '/SessionManager', args)
looper.run()
dbus_obj = DbusSessionManager(looper, dbus.SessionBus(), '/SessionManager', args)
looper.run()