<div dir="ltr"><div><div><div><div><div><div><div><div>Hi all,<br><br>I'm trying to use the Inhibit() API exposed by logind on dbus (org.freedesktop.login1.Manager) to prevent shutdown.<br></div>The call seems superficially to have worked, as the result from ListInhibitors() includes the block I created. However my machine is not prevented from shutting down.<br>
<br></div>I'm pretty stumped on how to proceed with debugging this, beyond checking what signals get sent (my program receives PrepareForShutdown(true)).<br></div>Could anyone suggest anything?<br><br></div>Code: <a href="http://pastebin.com/h0cWwz1m">http://pastebin.com/h0cWwz1m</a><br>
</div><br></div>Many thanks,<br></div>Brendan<br><br></div>(p.s. some relevant reference links to save clicking:<br><a href="http://www.freedesktop.org/wiki/Software/systemd/inhibit/">http://www.freedesktop.org/wiki/Software/systemd/inhibit/</a><br>
<a href="http://www.freedesktop.org/wiki/Software/systemd/logind/">http://www.freedesktop.org/wiki/Software/systemd/logind/</a><br>)<br></div>