Bug 70620 - daemon: fix logout time association
Summary: daemon: fix logout time association
Alias: None
Product: accountsservice
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Matthias Clasen
QA Contact:
Depends on:
Reported: 2013-10-18 14:51 UTC by Ondrej Holy
Modified: 2018-08-07 09:33 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:

fix logout time association (1.51 KB, patch)
2013-10-18 14:51 UTC, Ondrej Holy
Details | Splinter Review

Description Ondrej Holy 2013-10-18 14:51:24 UTC
Created attachment 87824 [details] [review]
fix logout time association

Use boot time as logout time only if it is bigger then login time. From some reasons there are sometimes boot records after the login records with lower times in wtmp... 

Also last utility have same problem with determining correct last time:
oholy19  pts/1        :0               Thu Oct 17 12:20   still logged in   
oholy19  pts/0        :0               Thu Oct 17 11:59 - 18:07  (06:07)    
reboot   system boot  3.11.3-201.fc19. Thu Oct 17 11:53 - 16:48 (1+04:55)   
oholy19  :0           :0               Thu Oct 17 11:54 - crash  (00:00)
(unknown :0           :0               Thu Oct 17 11:54 - 11:54  (00:00)

There should be "still logged in" instead of crash.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1003519
Comment 1 Ondrej Holy 2013-10-24 16:31:27 UTC
It should to be fixed the way to have right records in the wtmp file, however not sure who is responsible for the records there...
Comment 2 Ondrej Holy 2013-10-25 13:34:49 UTC
Currently BOOT_TIME record is written by systemd-update-utmp.service and USER_PROCESS record by gdm.service: 

reboot   system boot  3.11.3-201.fc19. Thu Oct 17 11:53 ... BOOT_TIME 
oholy19  :0           :0               Thu Oct 17 11:54 ... USER_PROCESS

...so we have to be sure gdm.service is called after systemd-update-utmp.service.

However don't know who writes BOOT_TIME record at systemd v204 (included in Fedora 19), because there is only systemd-update-utmp-shutdown.service (predecessor of systemd-update-utmp.service) which writes RUN_LVL records only.
Comment 3 Stef Walter 2013-11-07 16:00:31 UTC
Comment on attachment 87824 [details] [review]
fix logout time association

Review of attachment 87824 [details] [review]:

Makes sense to me. But Ray may want to give it a quick look over, since he's seen a lot of corner cases.
Comment 4 Ondrej Holy 2013-12-06 08:22:39 UTC
Looks like the bug has been fixed in Fedora 20 by systemd changes...
Comment 5 GitLab Migration User 2018-08-07 09:33:32 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/accountsservice/accountsservice/issues/40.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.