Setting real GID of another process

From: Nick Hill - RAL CISD Systems Group <NMH1_at_axprl1.rl.ac.uk>
Date: Thu, 21 Sep 1995 18:31:45 +0100 (BST)

Dear all,

A slightly strange request but I need to be able to do the equivalent of a
newgrp command within script files as some users need to be able to have CPU
time for different jobs accounted against different UID/GID combinations.
Executing a newgrp command in a script dosen't seem to work as as the man
page states "the shell you were using when you issued the newgrp command is
unavailable after the newgrp command finishes" so anything in the script file
after the newgrp command gets lost. What I need to be able to do is provide a
utility to for an existing process to set its real and effective gid without
making the original shell "unavailable". Using setregid from a program will
not do as you cannot give a PID to this call. I can exxamine the real and
effective gid via the /proc filesystem or via a table call but how can I set it?

By way of explanation this is needed for jobs run via packages such as NQS or
LSF so that users who have CPU time allocated to different projects controlled
via UNIX groups can charge time to different budgets or allocations from a
single userid. Believe me this is really wanted at our site.

-
Nick Hill

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Computing and Information Systems Department
Rutherford Appleton Laboratory
Chilton
Didcot Internet: nmh1_at_axprl1.rl.ac.uk
Oxfordshire Janet: nmh1_at_uk.ac.rl.axprl1
OX11 0QX DECnet: omni:.uk.ac.rl.axprl1::nmh1
ENGLAND 20054::nmh1
                       WWW: http://www.cis.rl.ac.uk/people/nmh1/contact.html
Tel: +44 (0)1235-445598
Fax: +44 (0)1235-446626
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Received on Thu Sep 21 1995 - 20:02:58 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT