[systemd-devel] Locking current session programmatically

Jan Alexander Steffens jan.steffens at gmail.com
Fri Jun 27 09:00:53 PDT 2014


Am 27.06.2014 15:45 schrieb "Ivan Shapovalov" <intelfx100 at gmail.com>:
>
> I want to lock my current session using a command-line tool (or a D-Bus
call).
>
> The only apparent way to do this is `loginctl lock-session
$XDG_SESSION_ID`.
> However, this results in an "Access denied" reply, which is somewhat
strange
> (I expect to be able to lock my own session).
>
> Is this by design or a bug? In either case, is it possible to lock the
current
> session?

As I understand logind doesn't keep any lock state. It just sends out Lock
or Unlock signals for sessions when certain things happen, such as a
session switch or forcing those signals to be sent using loginctl.

I guess nobody saw any value in letting a user lock their own sessions this
way, so the methods are privileged. The screen locking applications (such
as gnome-shell) already provide means to lock the session.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140627/2dabeaf3/attachment.html>


More information about the systemd-devel mailing list