[systemd-devel] How to Listen for SessionRemoved Signal
Djalal Harouni
tixxdz at opendz.org
Fri Jul 11 06:25:25 PDT 2014
On Thu, Jul 10, 2014 at 11:18:20PM -0500, Kurt von Laven wrote:
> Hello folks,
>
> Apologies if anybody is getting this message twice; I originally posted on
> dbus at 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>.
As Mantas said, this is wrong, your target here is shutdown... and your
process should only do small operations to record something or clean
things up...
So there is the 'PrepareForShutdown' signal, assume SessionRemoved, then
release the inhibitor lock ?
http://www.freedesktop.org/wiki/Software/systemd/logind/
Thanks
--
Djalal Harouni
http://opendz.org
More information about the systemd-devel
mailing list