gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Davey <Michael.Da...@coderage.org>
Subject Re: core/gumpenv.py and check_pgrep
Date Wed, 09 Jun 2004 08:23:23 GMT
Adam R. B. Jack wrote:

>
>>what about the "type" command/built-in?  Can we assume that either the
>>python execute command will always execute the command in bash or find
>>the "type" executable?
>>    
>>
>
>Nice idea. Not sure it is portable enough (for Microsoft) to be quite worth
>the effort, but maybe. I suspect there is a way to search a path for an
>executable, and that is how we ought implement it. Mind you, I could easily
>live w/ a *nix flavour that works nicer than Microsoft, since most of our
>big serves are *Nix.
>  
>
We could always fall back on the current way of doing things if the test 
fails.
I'll look at a patch to do this.

>  
>
>>>One things I dislike about
>>>pgrep is it doesn't kill grandchildren (a perfectly good attribute out
>>>outside of computing) -- so only kills the child shell, not even the main
>>>program below. That all said, it stops Gump from hanging.
>>>
>>>
>>>      
>>>
>>;) If you ensure that the group id is set for all children, then
>>wouldn't a pgrep -g id do the trick?  I don't know how you would achieve
>>that with python, but in C you would use setgid(id);
>>    
>>
>
>I once looked into group ids, thinking they might be the answer, but
>didn't/don't know enough about them to come up with a plan. I suspect that
>some fork/exec, along with this, and with popenN could do it (again, for
>*Nix) but I've not had time to work it out.
>  
>
group ids generally and setgid() (or maybe it is setpgrp()) specifically 
are explained well in "Advanced Programming in the UNIX Environment 
(APC)" by W.Richard Stevens, published by Addison Wesley.  I no longer 
have access to a copy.

>Maybe we could write some test modules to do this stuff (portably) and test
>them in unit tests, and then work them in.
>  
>
Good plan.  Might be worth downloading 
http://www.kohala.com/start/apue.html the sample source and see if there 
are any examples of this.

-- 
Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Mime
View raw message