Bug #62567 checking "how to check if pid exists" breaks when configure called with full pth
Submitted: 28 Sep 2011 21:53 Modified: 21 Jan 2014 8:51
Reporter: Maciej Bliziński Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.0.92 OS:Solaris
Assigned to: CPU Architecture:Any
Tags: Contribution, PS, solaris

[28 Sep 2011 21:53] Maciej Bliziński
Description:
When calling the configure script with full path, "check if pid exists" fails.

"Could not find the right ps and/or grep switches. Which OS is this?  See the Installation chapter in the Reference Manual."

When printing the full invocation of the check:

/usr/bin/ps -fp 28109 2> /dev/null | grep -- /home/maciej/src/opencsw/pkg/mysql5/branches/mysql-5.0.x/work/solaris9-sparc/build-isa-sparcv8/mysql-5.0.92/configure > /dev/null

The problem is that the /usr/bin/ps command only prints `basename $0` and not the full $0.

How to repeat:
Unpack sources, run the configure script using absolute path.

tar xfvz mysql-$version.tar.gz
cd mysql-$version
$(pwd)/configure

Suggested fix:
Replace all occurrences of $0 in this check with `basename $0`.
[28 Sep 2011 21:55] Maciej Bliziński
A patch for configure.in

Attachment: 0004-looking-for-ps-use-basename-0.patch (text/x-patch), 1.77 KiB.

[13 Nov 2011 19:04] Valeriy Kravchuk
Thank you for the patch contributed. Indeed, this change makes sense on Solaris with long pathnames like yours.
[21 Jan 2014 8:51] Ståle Deraas
Posted by developer:
 
The bug reported and the contribution attached is only relevant for MySQL built with autotools. MySQL is now built using CMake on all platforms, so closing bug.