Results 1 to 2 of 2

Thread: 10.04 LTS - ac -p from acct package incorrectly reporting login time. - Bug??

  1. #1
    Join Date
    May 2012
    Beans
    2

    10.04 LTS - ac -p from acct package incorrectly reporting login time. - Bug??

    I would like to view the total duration a user has been logged into the system for.

    To accomplish this I use `ac` from the package acct. However, this does not appear to be keeping time accurately.

    Code:
    #man ac
    ac  prints  out  a  report  of connect time (in hours) based on the logins/logouts in the current wtmp file.  A total is also printed out.
    That's just fine. But, The time is 17:17 and running:

    Code:
    #ac -p
    account-name 0.01
    No problem so far, this account has just been created and logged in.

    The time is now, 17:25 - Running:

    Code:
    #ac -p
    account-name 0.25
    A quick calculation - ((25 / 100) * 60) = 15. So this user has been logged in for 15 minutes. However, 17:25 - 17:17 is EIGHT minutes.

    Is my calculation incorrect, or is this a bug??

    If it is a bug, can you provide a workaround. Or an alternative way to get the total duration a user has been logged in for?

    Thanks,

  2. #2
    Join Date
    May 2012
    Beans
    2

    Re: 10.04 LTS - ac -p from acct package incorrectly reporting login time. - Bug??

    To update.

    running:
    Code:
    dump-utmp /var/log/wtmp
    I notice that the user has 2 TTY's open. The one running GDM and the other `gnome-terminal` which I am checking the ac -p output.

    Right!! The duration shown is a total of BOTH tty's!!! I tested this by wiping the wtmp file then logging on, switching user and then checking ac -p from another users terminal.

    The manual really isn't clear about that is it. heh.

    Consider solved.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •