timekpr not counting correctly

Asked by Max Gross on 2019-02-01

Allowed time per day is 60 minutes, nevertheless user is logged out after 34 minutes. timekpr.log shows that the program should sleep for 30 seconds, sometimes it wakes up after 2 seconds and adds 30 seconds (e.g.14:08:30). Any ideas? Thanks for your help!
Best regards
M
(kubuntu 18.04 kernel 4.15.0-45-lowlatency #48-Ubuntu SMP PREEMPT)
timekpr.log:
2019-02-01 14:06:57 Starting timekpr version 0.3.7
2019-02-01 14:06:57 Starting timekpr version 0.3.7
2019-02-01 14:06:57 Variables: GRACEPERIOD: 120 POLLTIME: 30 DEBUGME: True LOCKLASTS: 30 minutes
2019-02-01 14:06:57 Directories: LOGFILE: /var/log/timekpr.log TIMEKPRDIR: /etc/timekpr TIMEKPRWORK: /var/lib/timekpr TIMEKPRSHARED: /usr/share/timekpr
2019-02-01 14:06:57 Variables: GRACEPERIOD: 120 POLLTIME: 30 DEBUGME: True LOCKLASTS: 30 minutes
2019-02-01 14:06:57 checklockacct called
2019-02-01 14:06:57 Directories: LOGFILE: /var/log/timekpr.log TIMEKPRDIR: /etc/timekpr TIMEKPRWORK: /var/lib/timekpr TIMEKPRSHARED: /usr/share/timekpr
2019-02-01 14:06:57 checklockacct called
2019-02-01 14:06:57 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:06:57 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:07:27 checklockacct called
2019-02-01 14:07:27 checklockacct called
2019-02-01 14:07:27 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:07:27 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:07:57 checklockacct called
2019-02-01 14:07:57 checklockacct called
2019-02-01 14:07:57 configuration file for tobias exists
2019-02-01 14:07:57 configuration file for tobias exists
2019-02-01 14:07:57 User: tobias Day-Index: 5 Seconds-passed: 30
2019-02-01 14:07:57 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:07:57 User: tobias Day-Index: 5 Seconds-passed: 30
2019-02-01 14:07:57 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:08:27 checklockacct called
2019-02-01 14:08:27 checklockacct called
2019-02-01 14:08:27 configuration file for tobias exists
2019-02-01 14:08:27 This day's tobias.time file exists, adding time
2019-02-01 14:08:27 configuration file for tobias exists
2019-02-01 14:08:27 This day's tobias.time file exists, adding time
2019-02-01 14:08:28 User: tobias Day-Index: 5 Seconds-passed: 60
2019-02-01 14:08:28 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:08:30 User: tobias Day-Index: 5 Seconds-passed: 90
2019-02-01 14:08:30 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:08:58 checklockacct called
2019-02-01 14:08:58 configuration file for tobias exists
2019-02-01 14:08:58 This day's tobias.time file exists, adding time
2019-02-01 14:08:58 User: tobias Day-Index: 5 Seconds-passed: 120
2019-02-01 14:08:58 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:09:00 checklockacct called
2019-02-01 14:09:00 configuration file for tobias exists
2019-02-01 14:09:00 This day's tobias.time file exists, adding time
2019-02-01 14:09:00 User: tobias Day-Index: 5 Seconds-passed: 150
2019-02-01 14:09:00 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:09:28 checklockacct called
2019-02-01 14:09:28 configuration file for tobias exists
2019-02-01 14:09:28 This day's tobias.time file exists, adding time
2019-02-01 14:09:28 User: tobias Day-Index: 5 Seconds-passed: 180
2019-02-01 14:09:28 Finished checking all users, sleeping for 30 seconds
2019-02-01 14:09:30 checklockacct called
2019-02-01 14:09:30 configuration file for tobias exists
2019-02-01 14:09:30 This day's tobias.time file exists, adding time
2019-02-01 14:09:30 User: tobias Day-Index: 5 Seconds-passed: 210
2019-02-01 14:09:30 Finished checking all users, sleeping for 30 seconds

Question information

Language:
English Edit question
Status:
Solved
For:
timekpr-revived Edit question
Assignee:
No assignee Edit question
Solved by:
Max Gross
Solved:
2019-02-11
Last query:
2019-02-11
Last reply:
Eduards Bezverhijs (mjasnik) said : #1

It looks like 2 instances are running at the same time...
Does this happen even after restart?
Can You send me the results of: ps -ef | grep timek

Max Gross (mgrmx) said : #2

Thank you for your quick reaction!
ps -ef | grep timek gives:
root 1200 1 0 10:38 ? 00:00:00 /bin/bash /usr/bin/timekpr
root 1204 1200 0 10:38 ? 00:00:01 /usr/bin/python2 /usr/share/pyshared/timekpr/timekpr.py
c 1690 1 0 10:38 ? 00:00:00 /bin/bash /usr/bin/timekpr-client
c 1697 1690 0 10:38 ? 00:00:00 /usr/bin/python2 /usr/share/pyshared/timekpr/timekpr-client.py
c 25795 1703 0 16:51 pts/0 00:00:00 grep --color=auto timek

obviously direct after restart...

Eduards Bezverhijs (mjasnik) said : #3

From pcoess view, all seems fine, does the issue still exists?

Max Gross (mgrmx) said : #4

Yes, still the same problem... any hints?

Eduards Bezverhijs (mjasnik) said : #5

Well, it still seems that timekpr is running twice the process count it needs to be running. I just can't figure out how and why.
This problem is very unusual and strange.

Do You have shared storage for multiple computers or it's single computer You're having problem with?

Can we do this:
1. start up the computer
2. log in as the affected user
3. spot the problem and right away please
3.1. run: ps -ef | grep timek
3.2. send me the /var/log/timekpr.log + /etc/timekpr.conf files (You can do it via e-mail)

Eduards Bezverhijs (mjasnik) said : #6

Please send me this as well: dpkg -l | grep timek

Max Gross (mgrmx) said : #7

Thank you for the hints! I was able to spot the problem: Obviously there were files left from a previous installation of timekpr-beta, so I found two start-scripts in /etc/init.d: timekpr and timekpr-beta. Interestingly that was no problem if the admin was logged in, but as normal user, as you suspected, two instances of timekpr were running.
I made apt-get purge and did a fresh install. Up to now it seems to work. Thanks for your help!
And thanks for all the effort to get this helpful program running!
Best regards