Session lock still counting time

Asked by Iyad Kandalaft

On Ubuntu 20.04 with GDM3, inactive time is still being counted against the user's defined limit.

From the readme: "some Desktop Environments consider user session to be inactive by setting property IdleHint in org.freedesktop.login1 session when screen is locked, some do the same but only when screen turns off and some do not that all"

2 questions:
- Can you clarify how I can check the above for Ubuntu 20.04?
- What is the recommended approach to ensure that time is not accounted when the user locks the session on ubuntu 20.04?

Logs: https://timekpr-logs.s3.us-east-1.amazonaws.com/timekprlogs.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIATKS2E2HLMW2FI6VE%2F20220601%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220601T204746Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=838f1673dc76840cbc2efdcaf92c6fc9cff4bc6e97467091900f0f515fd2e754

#### Supporting information #####

$ apt list --installed gdm3
Listing... Done
gdm3/focal-updates,now 3.36.3-0ubuntu0.20.04.4 amd64 [installed,automatic]

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

$ uname -a
Linux desktop2 5.13.0-44-generic #49~20.04.1-Ubuntu SMP Wed May 18 18:44:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Checked that session configuration includes GDM
[SESSION]
#### this section contains configuration about sessions
# session types timekpr will track
TIMEKPR_SESSION_TYPES_CTRL = x11;wayland;mir
# session types timekpr will ignore explicitly
TIMEKPR_SESSION_TYPES_EXCL = tty;unspecified
# users timekpr will ignore explicitly
TIMEKPR_USERS_EXCL = testtimekpr;gdm;kdm;lightdm;mdm;lxdm;xdm;sddm;cdm

Checked that track inactive is false
timekpr.conf: TIMEKPR_TRACK_INACTIVE = False
timekpr.owen.conf: TIMEKPR_TRACK_INACTIVE = False

Question information

Language:
English Edit question
Status:
Needs information
For:
Timekpr-nExT Edit question
Assignee:
Eduards Bezverhijs Edit question
Last query:
Last reply:
Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#1

First of all, thanks for providing log files and configuration files already in question, much appreciated.

Please clarify:
1. did it actually lock the screen when restriction is enforced?
2. which DE (Desktop Environment) is used (Gnome, KDE, XFCE, ...)?

My findings so far are: session lock detection is not working from manager perspective for your installation, however it seems that, if user is logged in, screensaver lock reporting from user session is detected (this was a workaround I implemented to cover as much DEs as possible).

This may mean that there might be a bug when timekpr disregards lock detection from client application for some reason or other, but to verify this, I need answers to questions above.
In addition to that, please share /tmp/timekpr*log files too, these ar client application log files, they may give me additional information to reproduce the situation and if this is a bug, solve it.

Thanks.

Revision history for this message
Iyad Kandalaft (iyadkandalaft) said (last edit ):
#2

I left out a couple of pieces of information. The user was logged in the day before (may 31st) and used to all their allowed time (2 hrs). The user locked their screen rather than logging out. The next day (june 1st), timekpr would not allow the user to login because it has continued counting time from midnight (16hrs from midnight until 4PM), which exceeded the allowed time for the day (2 hrs).

To answer your question
1. Yes it enforces the restrictions - to be specific, it locks the screen immediately after the user authenticated
2. It's gnome3

Revision history for this message
Iyad Kandalaft (iyadkandalaft) said :
#3
Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#4

ok, I see that from client the timekpr screensaver handshake does happen, it's quite weird, tho, that gnome does not work with manager interface, but I'll check that.

I'll try to reproduce the issue when I get home from work.

So this is 20.04 latest updates, i.e. standard installation, right?

And please post the version of timekpr too, because there are at least 3 possible versions (stable from ppa, beta from ppa and stable older version from debian).
Universal command: dpkg -l | grep timekpr

Revision history for this message
Iyad Kandalaft (iyadkandalaft) said :
#5

Yes it's ubuntu 20.04 standard install, latest updates. I don't believe I've made any mods to it in any way.

$ dpkg -l | grep timekpr
ii timekpr-next 0.5.3-1ubuntu1~ppa1~ubuntu20.04.1 amd64 Keep control of computer usage

Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#6

I had a closer look at the code and log files, lock detection from client seems to work... but it looks like it worked once.

The reason why it counts time is that system reports that user session is active (logged in and is in foreground) and it's not idle.
Client app should report that it entered in screensaver mode, however it does not.

So, the question is whether your user killed or terminated client application? That midnight you mentioned, did the screen turn off when session was locked?

Can you help with this problem?

Provide an answer of your own, or ask Iyad Kandalaft for more information if necessary.

To post a message you must log in.