Operating System - Linux
1827756 Members
2863 Online
109969 Solutions
New Discussion

Re: equivalent of /usr/lib/acct in Linux

 
SOLVED
Go to solution
Paddy_1
Valued Contributor

equivalent of /usr/lib/acct in Linux

We run some regular shell scripts on our HP-Boxes based on /usr/lib/acct features.
Now i want to retain the commands when i modify the shell script on Linux.
I searched the documentation for it but couldnt find any.
Can someone help me find how to use the prtacct and other acct features on a linux server.
Thank you in advance
Paddy
The sufficiency of my merit is to know that my merit is NOT sufficient
7 REPLIES 7
Stuart Browne
Honored Contributor

Re: equivalent of /usr/lib/acct in Linux

I'm afriad I'm not from the HPUX world, and do not know what /usr/lib/acct does.

What sort of details does this give you?

What sort of details do you want to end up with?
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: equivalent of /usr/lib/acct in Linux

If you really want those features on Linux, you're going to have to port them.

Problem is HP-UX is proprietary and you're not likely to get source code access.

People have had 30 year careers at HP and never seen souce code.

I'm not sure if this is a command set owned by HP

I have doubts but these two links might give you a clue.
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/acct-6.3.2/

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/upacct-1.2/

I don't think LVM was originally ported to Linux by looking at the source code. Some brave soul just decided to port the functionality. That may have changed.

P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Paddy_1
Valued Contributor

Re: equivalent of /usr/lib/acct in Linux

Stuart,
here is my HP's /usr/lib/acct
acctcms acctcon2 accton acctwtmp diskusg lastlogin prdaily remove turnacct
acctcom acctdisk acctprc chargefee dodisk monacct prtacct runacct utmp2wtmp
acctcon acctdusg acctprc1 ckpacct fwtmp nulladm ptecms.awk shutacct vxdiskusg
acctcon1 acctmerg acctprc2 closewtmp holidays prctmp ptelus.awk startup wtmpfix

i will not be using all of them but a few like acctcon and runacct with diskusg.
I can see the port of nulladm as rewriting touch with permissions.beyond that i guess i have to write my own port.
thank you for the inputs.
appreciate your time
Paddy
The sufficiency of my merit is to know that my merit is NOT sufficient
Steven E. Protter
Exalted Contributor
Solution

Re: equivalent of /usr/lib/acct in Linux

Paddy, when you write the port, please share.

I'm thinking about porting the chkconfig command from Linux to HP-UX and the service command.

P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Paddy_1
Valued Contributor

Re: equivalent of /usr/lib/acct in Linux

Sure thing stuart.In Linux world i assumed that goes without saying.
By the way i would appreciate if you can point me some sources of literature for the porting.
Thank you for the attention
Paddy
The sufficiency of my merit is to know that my merit is NOT sufficient
Paddy_1
Valued Contributor

Re: equivalent of /usr/lib/acct in Linux

hough i didnt port it this is what i used in lieu of "quot" command in USL systems.
This is scripted in perl and fairly simple.
----------------------------------
use File::Find;
open F,"while( ){
my $root = (split)[1];
local %b=();
print "$root\n";
find(sub{
my ($uid, $blocks) = (lstat)[4,12];
$b{$uid} += $blocks;
},
$root
);
for( sort{$b{$b}<=>$b{$a}} keys %b ){
print $b{$_},"\t".getpwuid($_)."\n";
}
}

The sufficiency of my merit is to know that my merit is NOT sufficient
Bill Douglass
Esteemed Contributor

Re: equivalent of /usr/lib/acct in Linux

You can use ac to get connect time accounting on a system. Of source, quota will give you disk usage.

ac is part of the pacct RPM. quota is of course provided by the quota package.