One thing I dislike about Python (for Gump) is we've not found a nicer way to timeout processes. One thing I dislike about Gump's implementation (for this part) is that it runs the program, not just detects it on the PATH - but this is 'cos since we had code 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 work on a patch ... I think some folks could use pgrep on Microsoft platforms, so please be cautious of those. Perhaps (in that case) continue with -help. [There are a few places where OS checks are made already, you could copy those.] BTW: I could be talked into deprecating pgrep, in favour of 'timeout' (the program Sam found, if it could be coded for multi-threads/multi-CPU). regards, Adam ----- Original Message ----- From: "Michael Davey" <[EMAIL PROTECTED]> To: "Gump code and data" <[EMAIL PROTECTED]> Sent: Saturday, June 05, 2004 3:19 PM Subject: core/gumpenv.py and check_pgrep > Hi, > > PythonGump's check_pgrep test fails on Solaris when pgrep is present. > The problem is that pgrep returns error code 2 on Solaris but code 0 on > Linux: > > bash$ pgrep -help > pgrep: illegal option -- h > Usage: pgrep [-flnovx] [-d delim] [-P ppidlist] [-g pgrplist] [-s sidlist] > [-u euidlist] [-U uidlist] [-G gidlist] [-J projidlist] > [-T taskidlist] [-t termlist] [pattern] > bash$ echo $? > 2 > > > Here is the relevent section of the Solaris 9 pgrep/pkill man page: > > EXIT STATUS > The following exit values are returned: > > 0 One or more processes were matched. > > 1 No processes were matched. > > 2 Invalid command line options were specified. > > 3 A fatal error occurred. > > > One possible fix would be to issue "pgrep init" instead of "pgrep > -help". I *think* that all *nix has the init process. If agreeable, > I'll submit a patch. > > -- > Michael > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
