Re: [AMMRL] AMMRL: Accounting by computer login - How to prohibit gaming the system

From: David Richardson via groups.io <david.richardson=ucf.edu_at_groups.io>
Date: Tue, 26 Aug 2025 17:17:29 +0000

Hi all,

Since so many of us seem to be using the last command to track usage, I
figure this might be a good thread to bring this up.

I have always used logrotate to dump the output from last into a file on the
first of every month. Was fairly straightforward by editing the wtmp rotation
settings with:

/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 12
    prerotate
      ac -p -f /var/log/wtmp > /home/nmrsu/logs/usage_`date +"%Y%m%d"`.txt
      last -f /var/log/wtmp > /home/nmrsu/logs/logins_`date +"%Y%m%d"`.csv
      chown -R nmrsu /home/nmrsu/logs
    endscript
}

in logrotate.conf. Since switching to Alma, I can't get this to work. I have
tried to track down how/why it fails but haven't made any progress. I imagine
logrotation is somehow different in Alma. I now just manually run the portion
of the previous code involving last in a terminal when I go to do billing, but
it was easier to have the csv file simply waiting for me. Anyone have any
insight into getting logrotation to work as it did in CentOS?

Regards,
David

David Richardson, Ph.D.
Director, NMR Facility and Cryogenic Services
Office of Research
University of Central Florida
david.richardson_at_ucf.edu
407-823-2961
http://sciences.ucf.edu/chemistry/nmr/



> From: main_at_ammrl.groups.io On Behalf Of gregory.wylie via groups.io
> Sent: Tuesday, August 26, 2025 09:06
> To: main_at_ammrl.groups.io
> Subject: Re: [AMMRL] AMMRL: Accounting by computer login - How to prohibit gaming the system

Hi Everyone

We have noticed that when using the Bruker accounting file we miss time, and
have started comparing our accounting with the reservation system we use. We
are also going to start using last files as well to see how things turn out
that way too. I was able to replicate some of the missing time issues we were
seeing with the Bruker accounting file. A couple things we found that cause
us problems:
1. Double starting the software
2. If the user started the software from terminal and then closes the terminal.
3. Not waiting for the software to fully close before logging out of the computer.

Most often these result in miss matched line pairs in the Bruker accounting
file so our current scripts throw them out. This has resulted in a potential
lose of ~1500 hours of billable time on 1 machine over a year. We only have
1 Bruker that runs manually all others are in IconNMR and we have not seen
any issues on these systems.

We do think using last will work better as we currently use last to compare
with the reservation system to look for users who may be abusing the rules
of usage. We do this twice a month and send out emails to offenders to be
better. We don't think users are doing anything intentionally because if
we find too many issues in a month we will ban the user from the system!

Very interested to see what others are doing as well.

Greg

Gregory P. Wylie, Ph.D
NMR Facility Manager
Texas A&M University
Department of Chemistry #3255
580 Ross St.
College Station, TX 77843-3255
gpwylie_at_tamu.edu<mailto:gpwylie_at_tamu.edu>
979.458.0705 (voice)
979.845.4719 (fax)
706.206.0007 (cell)
http://nmr.tamu.edu




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#2755): https://urldefense.com/v3/__https://ammrl.groups=
.io/g/main/message/2755__;!!PvDODwlR4mBZyAb0!Wwjs5AZh8p47UgPDp8AXYLwUZ_ed9A=
24OdWhDI62H4IyGysRPabYqHKw7bA4Sf0URYxL6Qnv8Gyws4Jimk8osOKXFjwd$
Mute This Topic: https://urldefense.com/v3/__https://groups.io/mt/114891633=
/7559972__;!!PvDODwlR4mBZyAb0!Wwjs5AZh8p47UgPDp8AXYLwUZ_ed9A24OdWhDI62H4IyG=
ysRPabYqHKw7bA4Sf0URYxL6Qnv8Gyws4Jimk8osKqoFWRB$
Group Owner: main+owner_at_ammrl.groups.io
-=-=-=-=-=-=-=-=-=-=-=-




Received on Tue Aug 26 2025 - 10:18:42 MST

This archive was generated by hypermail 2.4.0 : Mon Sep 01 2025 - 15:37:08 MST