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

logind StopIdleSessionSec kills user processes even when KillUserProcesses=no is set

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.4
    • systemd
    • No
    • None
    • sst_cs_plumbers
    • ssg_core_services
    • 5
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

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

      Once the timeout specified in the StopIdleSessionSec expires, logind kills user processes even though KillUserProcesses=no is also set.

      Please provide the package NVR for which bug is seen:

      systemd-252-32.el9_4

      How reproducible:

      deterministic

      Steps to reproduce

      1. # vim /etc/systemd/logind.conf
        [Login]
        StopIdleSessionSec=60
        KillUserProcesses=no
        ...
        
      2. Reboot the system or do systemctl reload-or-restart systemd-logind.service
      3. Once systemd-logind.service is reloaded start a new tmux session and run sleep command there, e.g.:
        tmux new -s sleep
        sleep 1d
        # then Ctrl+b and d (detach)
        
      4. Wait 60s and your TTY / serial console / ssh session should be stopped.

      Expected results

      Session is stopped after 60s but when user logs in afterwards, they should still see their tmux session and other processes they started in their session before it was stopped.

      Actual results

      Session is stopped after 60s and all user processes are killed.

      Why is it needed

      To use logind to implement idle user sessions termination while preserving running user programs such as tmux (so users are able to login after their session terminates and continue where they left off). This is needed to satisfy requirements coming from security policies, e.g. STIG - https://stigaview.com/products/rhel9/v1r3/RHEL-09-412080/

            msekleta@redhat.com Michal Sekletar
            mmarhefk@redhat.com Matus Marhefka
            systemd maint mailing list systemd maint mailing list
            Frantisek Sumsal Frantisek Sumsal
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: