[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

601.0. "Project accounting" by AUNTB::BRILEY () Wed Nov 18 1987 12:06

    I have a customer who would like to do project accounting.  Is there
    any way to do this?  The customer would like the user to be able
    to select the project under which they would be accounted for at
    login time.  They would like to do this without having seperate
    user accounts for each project.  Even better would be to have the
    user change the project he is being accounted for while he is logged
    in.
    
    I've looked at the accounting utility.  And I'm not sure that any
    of the things I'm talking about are easily doable, if they are possible
    at all.                                    
    
    Thanks for your time,
    
    Rob
T.RTitleUserPersonal
Name
DateLines
601.1Use CTL$T_ACCOUNTTHE780::MESSENGERThings fall apart-it's scientificThu Nov 19 1987 23:0422
    Have your customer write a kernel-mode routine that places the name
    of the project into CTL$T_ACCOUNT in P1 space. It's only 8 bytes,
    so he'll probably have to use some kind of coding scheme.
    
    Basically, invoke this program at login time to get the project
    number for the user, and put it in. When the user logs out (here's
    the trick) it will be written to the system accounting file, along
    with his process statistics. You can then get accounting to sort-break
    on this field for output (VMS doesn't use the ACCOUNT field, so
    this is kosher).
    
    Caveats: this will NOT allow the user to change projects in mid-stream.
    It will also NOT pick up anything the user does in a sub-process
    (if you want that, use the field PCB$T_ACCOUNT (in the PCB) AS WELL
    AS CTL$T_ACCOUNT)
    
    If you were VERY creative, you could give the user a sub-process
    for each of several projects (appropriately setting CTL$T_ACCOUNT)
    and that would allow him to dynamically switch (using ATTACH).
    
    Honest, this works -- I've helped people do it.
    					- HBM
601.2cheaper with $sndjbcCXCAD::LARSENGlen LarsenTue Dec 15 1987 21:1621
        Another possibility (and takes less privs -- OPER?) is to hack
        one of the accounting fields, especially since DEC provides
        you with one.  This would require a little thought and the
        normal post-processing of the accounting file.  

a short example of sending text to the accounting file ala semi-BLISS:
        
local
    sndjbc_itmlst	: $itmlst_decl(items=1);

$itmlst_init(itmlst=sndjbc_itmlst,
    (itmcod=sjc$_accounting_message, bufadr=.buf_adr, bufsiz=.buf_len));

status=$sndjbcw(
    efn=0,
    func=sjc$_write_accounting,
    nullarg=0,
    itmlst=sndjbc_itmlst,
    iosb=0,
    astadr=0,
    astprm=0);