[systemd-devel] systemd IdleAction for lock is not working

Lennart Poettering lennart at poettering.net
Tue Jun 16 08:39:56 UTC 2020


On Mi, 03.06.20 17:51, seshu pyla (seshu.pyla at gmail.com) wrote:

> Hi,
>
>
>
> I am trying the below logind parameters to configure session lock in my
> system.
>
>
>
> /etc/systemd/logind.conf
>
> IdleAction=Lock
>
> IdleActionSec=1min
>
>
>
> But, with above configurations there is no effect, so I have looked in to
> the code and after the below change the lock event is sent and session lock
> is happening successfully.
>
> --- a/src/login/logind.c
>
> +++ b/src/login/logind.c
>
> @@ -1019,7 +1019,7 @@ static int
> manager_dispatch_idle_action(sd_event_source *s, uint64_t t, void *us
>
>                      (m->idle_action_not_before_usec <= 0 || n >=
> m->idle_action_not_before_usec + m->idle_action_usec)) {
>
>                          log_info("System idle. Taking action.");
>
>
>
> -                        manager_handle_action(m, 0, m->idle_action, false,
> false);
>
> +                        manager_handle_action(m, 0, m->idle_action, false,
> true);
>
>                          m->idle_action_not_before_usec = n;
>
>                  }
>
>
>
> Is there any specific reason the “Lock” action is not handling in systemd?
>
>
>
> Is there any plan in future if the “Lock” action is handled in system?

This might be a bug. Please file a bug on github about thus. Thanks

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list