Hello folks, Apologies if anybody is getting this message twice; I originally posted on d...@lists.freedesktop.org and was directed here.
I am attempting to listen to the SessionRemoved signal from the login manager <http://www.freedesktop.org/wiki/Software/systemd/logind/>. I have no trouble in the case where the user logs out and waits for ~15 seconds before shutting down, but when the user shuts down the system without first logging out I don't hear the SessionRemoved signal in time. I would've thought that inhibiting shutdown (by calling the Inhibit method of the login manager <http://www.freedesktop.org/wiki/Software/systemd/inhibit/>) would be the appropriate way to keep my process alive long enough to record the SessionRemoved signal before my process gets killed. Apparently that is not the case though. I am fairly certain that I am actually inhibiting shutdown, because my process shows up when I call ListInhibitors in D-Feet <https://wiki.gnome.org/action/show/Apps/DFeet>. In case it's relevant, I'm using the delay mode of the inhibit method, and my process runs as root. To test whether my process was running in the user session, I called getsid (0) <http://linux.about.com/library/cmd/blcmdl2_getsid.htm>. It returned the PID of my process, which does not match the session ID of the SessionRemoved signals I was able to record. Is this a legitimate way to verify that my process isn't running in the user session? My original assumption was that my process couldn't possibly be in the user session because I am able to hear the SessionRemoved signal when the user logs out and waits for ~15 seconds. Is that a bad assumption to make? I was advised that some shutdown commands bypass logind, so I tried shutting down several different ways (systemctl shutdown, shutdown now, sudo shutdown now, calling Shutdown method on org.gnome.SessionManager from D-Feet, and the typical GUI way). In all cases I got the same result: I didn't hear the SessionRemoved signal. If anyone has any suggestions on how to debug this or knows what I am missing here, that would be greatly appreciated. Please let me know if any additional details would be helpful. Be well, Kurt -- Kurt von Laven | Endless Mobile | EndlessM.com <http://endlessm.com/>
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel