🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.large
7 messages
7 total messages Started by Geoff Lane Tue, 28 Jul 1992 10:24
Can project based accounting be done on Unix?
#7
Author: Geoff Lane
Date: Tue, 28 Jul 1992 10:24
23 lines
1560 bytes
Against my better wishes I have to implement a `project' based accounting
system on top of the standard AT&T Unix process accounting.  Projects are
represented by arbitary eight character text strings (which could be mapped
to small integers in the implementation) and each process that executes has
to be associated with one such string.  Projects can have one or more users
and each user can be a member of one or more projects (but only one project
at a time.) Users have to be able to change projects at any point with a
command and all subsequent processes executed in the same login session
have to be associated with the new project. 

I don't really want to modify the Unix kernel unless it is absolutely
necessary.

So far the best idea anyone has suggested is using the Unix groups as
projects but I dislike using groups for two disjoint purposes (the project
structure would impose restrictions on how users could share files is one
obvious problem.) 

Has anyone had to do something similar and is willing to share their
experiences?
-- 
Geoff. Lane.                                  Janet: zzassgl@uk.ac.mcc.uts
UTS Sys Admin, Manchester Computing Centre, Oxford Rd, Manchester, M13 9PL
Re: Can project based accounting be done on Unix?
#8
Author: Lindsay Patten
Date: Wed, 29 Jul 1992 19:55
8 lines
887 bytes
Can you not just record the time and project name when they change
projects and then go through the process accounting assigning the
cost of the process to the project then in effect?
-- 
Lindsay Patten
Pattern Analysis & Machine Intelligence Group         lindsay@pami.waterloo.edu
Dept. of Systems Design Engineering  {utai|decvax|uunet}!watmath!watnow!lindsay
University of Waterloo                   Neither I nor PAMI speak for the other
Re: Can project based accounting be done on Unix?
#13
Author: Bernd Felsche
Date: Thu, 30 Jul 1992 01:53
36 lines
2344 bytes
In <5453@mccuts.uts.mcc.ac.uk> zzassgl@uts.mcc.ac.uk (Geoff Lane) writes:

>Against my better wishes I have to implement a `project' based accounting
>system on top of the standard AT&T Unix process accounting.  Projects are
>represented by arbitary eight character text strings (which could be mapped
>to small integers in the implementation) and each process that executes has
>to be associated with one such string.  Projects can have one or more users
>and each user can be a member of one or more projects (but only one project
>at a time.) Users have to be able to change projects at any point with a
>command and all subsequent processes executed in the same login session
>have to be associated with the new project. 

>I don't really want to modify the Unix kernel unless it is absolutely
>necessary.

It appears that all that is necessary is for you to write
new (additional) analysis programs for the collected data
(pacct* files), and to record the date-time when each user
switches projects, via a short set[ug]id program.

Users can then switch between project within the same login
session, simply by executing the project-switch command.

The structure of the pacct files is well documented and it
looks easy enough to do a project-by-project analysis by
correlating the user-project switch times with process
accounting information. You can poke your project reporting
stuff into the existing scripts which initiate periodic
process accounting; daily/monthly/annually.

I'll leave the options/extensions up to you as an exercise. :-)
-- 
+-----+ Bernd Felsche                     _--_|\  #include <std/disclaimer.h>
| | | | MetaPro Systems Pty Ltd          /      \ bernie@metapro.DIALix.oz.au
| | | | 328 Albany Highway,              X_.--._/         Fax: +61 9 472 3337
|m|p|s| Victoria Park, Western Australia 6100  v        Phone: +61 9 362 9355
Re: Can project based accounting be done on Unix?
#9
Author: Jean-Francois Lamy
Date: Thu, 30 Jul 1992 02:10
31 lines
2293 bytes
Control Data has both project accounting and job accounting in EP/IX.  I am
awaiting copies of their software for evaluation.  They seem to have used some
kernel assistance, and generate additional files beyond standard pacct.

Since we don't have source, what has been done here is to have a command
called setacct that writes a record to the ptmp file that contains the user
name, tty and account name (project name in your case).  Noting the tty allows
a program reading the ptmp file to tally related accounting records until the
same tty becomes used by another user or another account is used.  This gives
a sort-of-kind-of combination between job-based and project based accounting
for cpu time.

For files, faced with similar concerns about not mixing up access rights
(groups) with accounting (project names/account names), we ended up charging
file names based on their naming.  I.e. my home directory is /u/_rec07/j.lamy
and is charged to account rec07; if I create a subdirectory called _blah the
spaced used under blah would be charged to account blah (assuming  i have
the right to bill to that account; the leftmost authorised account is used).

Neither of these techniques require kernel hacks.  Using ttys for identifying
sessions is crude; it has forced us to hack our batch system to run batch jobs
under a controlling tty (gah).  The technique has been tested on MIPS RISC/os
4.x and AIX.

In any case, I strongly feel this is something best done in the kernel, and
provided by the vendor.  Kudos to Control Data for at least recognising the
need...

Jean-Francois Lamy                                        |   lamy@sobeco.com
Computer Networks and Systems				  |   lamy@sobeco.ca
Sobeco Ernst & Young, Montreal, Canada H2Z 1Y7            |   uunet!sobeco!lamy
Re: Can project based accounting be done on Unix?
#10
Author: Geoff Lane
Date: Thu, 30 Jul 1992 08:33
22 lines
1478 bytes
In article <Bs6205.22L@watserv1.uwaterloo.ca> lindsay@watnow.waterloo.edu (Lindsay Patten) writes:
>Can you not just record the time and project name when they change
>projects and then go through the process accounting assigning the
>cost of the process to the project then in effect?
>Lindsay Patten


The information stored in the accounting records for UTS (which is the
system I have to deal with) does not allow unambiguious mapping of the
project information to user processes.  UTS Unix allows multiple concurrent
logins to the same userid and the controlling tty field (the obvious first
thing to use to distinguish the logins) is not aways maintained correctly
(XDM logins, for instance, need not, and on UTS, do not, update the utmp or
wtmp files. There are other sources of user processes, such as batch work
run under NQS, where there is no controlling tty at all.) 


 

-- 
Geoff. Lane.                                  Janet: zzassgl@uk.ac.mcc.uts
UTS Sys Admin, Manchester Computing Centre, Oxford Rd, Manchester, M13 9PL
Re: Can project based accounting be done on Unix?
#11
Author: Scott Merrilees
Date: Fri, 31 Jul 1992 02:29
23 lines
1667 bytes
lindsay@watnow.waterloo.edu (Lindsay Patten) writes:
>Can you not just record the time and project name when they change
>projects and then go through the process accounting assigning the
>cost of the process to the project then in effect?

How do you then generally distinguish between one user running multiple
sessions at the same time detached from a tty?  On the same tty?
Seems like you need some way of associating parent and child processes.

The easiest way may be use utilise unused bits in the ac_flag field of the
accounting record.  You may need to write a syscall to do this, and you may
also need to revector the fork() system call to be able to propogate this
information to subprocesses.

Looking at risc/os, there doesn't seem to be many spare bits in ac_flag.
Maybe exit can be revectored and extra info written somewhere ? Off course,
storing this extra info before exit should also be interesting.

Also, how do you charge for the parent shell ? time based split, exec on
new project ?
-- 
Scott Merrilees, BHP Information Technology, Newcastle, Australia
Internet: Sm@bhpese.oz.au   Phone: +61 49 40 2132   Fax: ... 2165
Re: Can project based accounting be done on Unix?
#12
Author: Mathew BM LIM
Date: Fri, 31 Jul 1992 03:08
36 lines
2285 bytes
lamy@sobeco.com (Jean-Francois Lamy) writes:

>In any case, I strongly feel this is something best done in the kernel, and
>provided by the vendor.  Kudos to Control Data for at least recognising the
>need...

Yes I must agree that this is best done in the kernel, however, it can still
be done effectively at the user level in certain environments.
We currently run a locally developed package to do project based accounting
and CPU quota.

The technique we use is to "wrap" the users login shell, batch job, etc. 
with another process which handles the accounting and quota stuff.
This system works well for us, we've been running this for about a year now 
on a SYSV4 machine and it's now quite stable and usable. But it's success is
probably largely because we have co-operative users. There are just too many
ways for a semi-determined user to circumvent such a system.

In short, user level accounting of this sort can be done, but the integrity
of the data cannot be guaranteed unless your users co-operate, or you have
a big enough stick to deter any would be offenders.

I have heard of several commercial packages which claim to be able to do
project based accounting. The one I know most about is SHARE II from
Softway, an Australian company. I believe that SHARE II is 
liscensed to Convex and Cray and form part of their operating system.

The other 2 packages I have only read short passages about is AIM Job
Accounting and UniSol JobACCT. I have phone numbers for these if anyone
wants them.


Mathew Lim, Unix Systems Programmer, ANU Supercomputer Facility,        
Australian National University, GPO Box 4, Canberra City, ACT, Australia 2601.
Telephone : +61 6 249 2750      | 
Fax       : +61 6 247 3425      | E-Mail  : M.Lim@anu.edu.au
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads