Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58872 - mysql-4.0.20 fails to configure on "checking for ps"
Summary: mysql-4.0.20 fails to configure on "checking for ps"
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-30 02:32 UTC by MAL
Modified: 2004-08-01 02:56 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MAL 2004-07-30 02:32:50 UTC
configure dies during the emerge of mysql-4.0.20 :

checking for ps... /bin/ps
checking "how to check if pid exists"... configure: error: Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.

I looked through mysql's configure for the relevant section, and it checks:

if ps p $$ 2> /dev/null | grep $0 >/dev/null

If that's false, it fails.  It turns out that ps puts a hyphen (-) in front of *some* process names in my ps output, and grep takes that as an option instead of an expression to grep for.

On the troublesome box, "\ps p $$"

gives:

  PID TTY      STAT   TIME COMMAND
22969 pts/0    S      0:00 -bash

but this on my workstation I get:

  PID TTY      STAT   TIME COMMAND
24378 pts/72   S      0:00 bash

(no - before bash).

"qpkg -I -f /bin/ps" reports two packages:

sys-apps/procps and sys-apps/psmisc

Neither of which have any strange use flags that could add this seemingly odd function.  The box in question runs grsecurity, which I guess could be responsible.  Does anyone know the cause?

As far as the fix is concerned, simply changing the line:

if $PS p $$ 2> /dev/null | grep $0 > /dev/null

to:

if $PS p $$ 2> /dev/null | grep -- $0 > /dev/null

does it, but I guess this is really an upstream fix.

Reproducible: Always
Steps to Reproduce:
1. emerge =dev-db/mysql-4.0.20

Actual Results:  
Fails to get past configure, with the above error.

Expected Results:  
Passed configure with flying monochrome.
Comment 1 MAL 2004-07-30 02:43:44 UTC
Upstream bug report is:

http://bugs.mysql.com/4825
Comment 2 MAL 2004-07-30 04:13:30 UTC
My apologies, it was down to /bin/ps being restricted to root and wheel group execute only.  As portage runs configure as 'portage', it couldn't execute ps at all.
Comment 3 Martin Holzer (RETIRED) gentoo-dev 2004-08-01 02:55:59 UTC
this is typical, if proc is not mounted eg. in a chroot