[torqueusers] changing session id.

Garrick Staples garrick at usc.edu
Wed Feb 23 09:57:28 MST 2005


This is the big mystery.  If you find a solution to this problem, we'd all love
to hear about it!

On Thu, Feb 17, 2005 at 09:08:44AM +0000, Steve Traylen alleged:
> 
> Hi,
> 
>   I am looking for some suggestions on how to deal with the problem
>   of users changing their session or group id and thus enabling 
>   themselves to leave process on batch workers. The code below highlights
>   a way to do this.
> 
>   Has anyone else considered this and have they implemented anything
>   to address the situation. Either to stop it in the first place or
>   to clean it up afterwards. For the clean up it is less than trivial
>   since we run two jobs per node so simply cleaning all process belonging
>   to a user in the epilogue is not an option.
> 
>      Steve
> 
>   
> #include <sys/types.h>
> #include <unistd.h>
> 
> int main(int argc, char **argv) {
>   pid_t p = fork();
>   if (p == (pid_t) -1) {
>     exit(0);              /* we failed.... */
>   } else if (p == 0) {    /* CHILD */
>     setsid();             /* new session */
>     setpgid(0, 0);
>   } else {                /* PARENT */
>     exit(0);
>   }
> 
>   /* Do something usefull here */
>   sleep(6000);
> }
> 
> 
> 
> -- 
> Steve Traylen
> s.traylen at rl.ac.uk
> http://www.gridpp.ac.uk/
> _______________________________________________
> torqueusers mailing list
> torqueusers at supercluster.org
> http://supercluster.org/mailman/listinfo/torqueusers

-- 
Garrick Staples, Linux/HPCC Administrator
University of Southern California
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20050223/04ee8b76/attachment-0001.bin


More information about the torqueusers mailing list