Bug 2156780

Summary: [RFE]: adjust the log severity of the idle message to an info level when StopIdleSessionSec is configured
Product: Red Hat Enterprise Linux 8 Reporter: Amey <abetkike>
Component: systemdAssignee: David Tardon <dtardon>
Status: CLOSED ERRATA QA Contact: Frantisek Sumsal <fsumsal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.7CC: dtardon, jamacku, peter.vreman, systemd-maint-list
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-239-73.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 09:07:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Amey 2022-12-28 17:24:58 UTC
Description of problem:

I have configured the new systemd feature StopIdleSessionSec. And seems to be working because I can see sessions being stopped. Sadly without any evidence why the user session is stopped.

Looking at https://github.com/redhat-plumbers/systemd-rhel8/commit/24439b08e3a3437b423553c385cde1d4cddf18f6#diff-0b375f3118a9ae0b86c5bd218491126a329817a5bfeb41fff8f164b36b00604cR676 the info that a session is idle is logged only on debug level instead of info level that to inform the administrator what is going on.

Can we please adjust the log severity of the idle message to an info level  so it is included in journal/syslog so that it is for administrators traceable why sessions are stopped?


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

1. Modify /etc/systemd/logind.conf, add 'StopIdleSessionSec=10'
2. sudo systemctl restart systemd-logind
3. Run 'while true; do echo $n; sleep 1; n=$(( n + 1 )); done'
4. Login again
5. Run 'sudo grep -i idle /var/log/messages /var/log/secure'

Actual Result:
- Session correct killed at 10 seconds
- After login again the grep does not give any result (for 'idle' keyword)

Expected results:

Below line logs about idle session, but its only in debug mode, can we get this for info (default) log severity?

log_debug("Session \"%s\" of user \"%s\" is idle, stopping.", s->id, s->user->name);


Additional info:

Comment 2 David Tardon 2023-01-06 11:10:26 UTC
Sounds reasonable.

Comment 8 errata-xmlrpc 2023-05-16 09:07:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (systemd bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2985