Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-24340

Session idle timeout "StopIdleSessionSec" doesn't seem to work properly

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • rhel-9.6
    • rhel-9.3.0
    • systemd
    • None
    • Important
    • ZStream
    • rhel-sst-cs-plumbers
    • ssg_core_services
    • 26
    • 5
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • Approved Blocker
    • None
    • None
    • All
    • None

      What were you trying to do that didn't work?

      STIG and other organizations require implementing StopIdleSessionSec=xxx in /etc/systemd/logind.conf.

      With latest RHEL8.9, it appears 2 issues arise when using the feature:

      1. The session disconnects even not when being idle
        Executing anything spawning a pager will end up getting disconnected, e.g. with following the journal and hitting Enter every second, or through browsing a man page and use the arrow keys.
      2. When specifying KillUserProcesses=no to let runaway processes execute in the background, processes are killed anyway, e.g.
        [user@vm-logind8 ~]$ nohup sleep 1234 &
        [1] 1705
        nohup: ignoring input and appending output to 'nohup.out'
        [user@vm-logind8 ~]$ <<< wait for idle timeout
        Connection to vm-logind8 closed by remote host.

        The journal shows sleep got killed:

        Feb 06 11:08:54 vm-logind8 systemd-logind[786]: Session "5" of user "user" is idle, stopping.
        Feb 06 11:08:54 vm-logind8 systemd[1]: session-5.scope: Killing process 1646 (sshd) with signal SIGTERM.
        Feb 06 11:08:54 vm-logind8 systemd[1]: session-5.scope: Killing process 1649 (sshd) with signal SIGTERM.
        Feb 06 11:08:54 vm-logind8 systemd[1]: session-5.scope: Killing process 1650 (bash) with signal SIGTERM.
        Feb 06 11:08:54 vm-logind8 systemd[1]: session-5.scope: Killing process 1705 (sleep) with signal SIGTERM.

        This hence tends to indicate that KillUserProcesses=no is just ignored by StopIdleSessionSec=xx.

      Please provide the package NVR for which bug is seen:

      systemd-239-78.el8.x86_64

      How reproducible:

      Always, see above description.

      Steps to reproduce

      1. Set StopIdleSessionSec=60 and restart logind
      2. Connect as a user, start browsing a manpage and use arrow keys to move in the manpage
      3. After 60 seconds the connection closes automatically despite moving in the manpage

              msekleta@redhat.com Michal Sekletar
              rhn-support-rmetrich Renaud Métrich
              systemd maint mailing list systemd maint mailing list
              Frantisek Sumsal Frantisek Sumsal
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: