Say you have a DBus service on the session bus (the per-user bus). Your service might get started via an
/etc/xdg/autostart/* file, or it might get started the first time some app tries to use your well-known service name. Either way, let's say that the DBus session bus is the process that starts your service.
And then the user logs out. So what happens? Does DBus send any actionable SIG<foo> signals to your service, or is it strait to
SIGKILL? Is there any other way to know the user is logging out? Basically, I have some cleanup actions I need to run, which includes killing sub-processes started with
Now you before you say, "
multiprocessing are evil, don't use them", in my current experiment, I'm not using them. I'm just trying to figure out how a Python DBus service can hook into something that allows it to run cleanup actions, whatever the overall architecture might be.
Any advice? Any examples? Note that my example will be running in a
GObject.MainLoop and is using Python3 on Ubuntu Precise (or Quantal).