Date: Thu, 26 May 2005 06:44:55 -0500 From: "Eugene Zegers" <ehazegers@mail.com> To: freebsd-questions@freebsd.org Subject: Logout procedure: Where to call own script? Message-ID: <20050526114455.1D5BF6EEF6@ws1-5.us4.outblaze.com>
next in thread | raw e-mail | index | archive | help
Hi,
In order to log the logintime for a person on a certain PC running FreeBSD 5.3,
I want to call a "logout procedure" when the person logs out (either out of Gnome or
with a shutdown) as follow:
last -y -t ttyv0 | awk '{print $1,$4,$5,$6,$9}' | loginperiod >> /home/user/<name>/Test.log
where loginperiod is a tested Perl script which will give the required output.
However, the total logintime is written in /var/log/wtmp during the logout process. Just after
that moment, I want to call my script, using the command sequence above, and seperately log the time
in /home of the user (or like: <user>_Timesheet.log instead of Test.log).
I have tried to call this script in /etc/rc.shutdown, but it only creates Test.log as an empty
file (the command above will give an output like: <name> <date> <time today> <time this month>
<total logins>).
Where, during the logout procedure, is /var/log/wtmp updated for the user time?
Where and how should I call the above command sequence in order to seperately log the logintime
for today using the last command??
Thank you in advance for any insights,
Eugene Zegers
--
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050526114455.1D5BF6EEF6>
