Skip to content

Commit

Permalink
logind: don't setup idle session watch for lock-screen and greeter
Browse files Browse the repository at this point in the history
Reason to skip the idle session logic for these session classes is that
they are idle by default.
  • Loading branch information
msekletar authored and yuwata committed Jan 3, 2024
1 parent b4a9d19 commit 508b478
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions man/logind.conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,11 @@
<term><varname>StopIdleSessionSec=</varname></term>

<listitem><para>Specifies a timeout in seconds, or a time span value after which
<filename>systemd-logind</filename> checks the idle state of all sessions. Every session that is idle for
longer then the timeout will be stopped. Defaults to <literal>infinity</literal>
(<filename>systemd-logind</filename> is not checking the idle state of sessions). For details about the syntax
of time spans, see
<filename>systemd-logind</filename> checks the idle state of all sessions. Every session that is idle
for longer than the timeout will be stopped. Note that this option doesn't apply to
<literal>greeter</literal> or <literal>lock-screen</literal> sessions. Defaults to
<literal>infinity</literal> (<filename>systemd-logind</filename> is not checking the idle state
of sessions). For details about the syntax of time spans, see
<citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para>

Expand Down
2 changes: 1 addition & 1 deletion src/login/logind-session.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ static int session_setup_stop_on_idle_timer(Session *s) {

assert(s);

if (s->manager->stop_idle_session_usec == USEC_INFINITY)
if (s->manager->stop_idle_session_usec == USEC_INFINITY || IN_SET(s->class, SESSION_GREETER, SESSION_LOCK_SCREEN))
return 0;

r = sd_event_add_time_relative(
Expand Down

0 comments on commit 508b478

Please sign in to comment.