Google Answers Logo
View Question
Q: OS X software to monitor login time ( Answered 5 out of 5 stars,   0 Comments )
Subject: OS X software to monitor login time
Category: Computers
Asked by: corbob-ga
List Price: $2.00
Posted: 14 Aug 2002 06:09 PDT
Expires: 13 Sep 2002 06:09 PDT
Question ID: 54485
I'm setting up a Cyber Cafe(with imacs) and I need to find some Mac OS
X software/method to monitor user login time in order to bill for
computer usage. Perhaps something that will even go so far as print
out an invoice when the user logs off?

Clarification of Question by corbob-ga on 14 Aug 2002 10:26 PDT
I have a varied programming and unix background, but I'm not very
familiar with OS X. If someone could point me in the correct direction
toward programming an app such as this for OS X, I'd be happy with
that answer as well.
Subject: Re: OS X software to monitor login time
Answered By: maniac-ga on 14 Aug 2002 17:58 PDT
Rated:5 out of 5 stars
Hello Corbob,

I will assume you are familiar with writing scripts and the command
line (from the terminal application). I have at least two ideas you
should be able to use to collect the information you need.

[1] From a terminal window, type
  apropos account
to get the following list...
ac(8)                    - connect time accounting
acct(2)                  - enable or disable process accounting
acct(5)                  - execution accounting file
accton(8)                - enable/disable system accounting

These are the man pages that describe the per user accounting that was
introduced in AT&T Unix a *long* time ago (15-20 years ago?). For
example, on my system...
  ac -d
lists the following information...
Aug  9  total      147.92
Aug 10  total       23.96
Aug 11  total       24.00
Aug 13  total       47.96
Aug 14  total       19.81
(I am not sure why the system charged me for 148 hours of use in a 24
hour day :-) on August 9th. The command
  ac -p
lists the following information...
        maniac     263.67
        total      263.67
which should sum to the values above. Ac is a very simple program, if
you need more complicated accounting (other than hours per day), you
will have to write a program. In case you don't know, enter
  man 8 ac
to get information about the system administrative program named ac or
  man 1 man
to get information about the man program itself.

[2] Customize the system with a "login hook" and "logoff hook". For
information, check out...

which describes a number of customizations. Basically, you can specify
a script or application which runs at login and logout (as well as
disable the reboot and shutdown commands). Check related pages on
Apple's web site for more detail.

If you need to search for more data, I suggest search phrases such as
"acct", "accounting", "login hook", "macosx", "unix" and similar
phrases for more sites to get information.

corbob-ga rated this answer:5 out of 5 stars
Exactly what I needed!  Thanks much

There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy