Bug #41883 mysql_zap not working on OS X 10.5.5
Submitted: 5 Jan 2009 19:54 Modified: 25 Jun 2009 2:25
Reporter: Nicklas Westerlund (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.1.30 OS:Mac OS X (10.5.5)
Assigned to: Jim Winstead CPU Architecture:Any
Tags: Contribution
Triage: Triaged: D2 (Serious)

[5 Jan 2009 19:54] Nicklas Westerlund
Description:
~/5.1.30/bin:08:46:45:Qalbi $ ./mysql_zap mysqld_safe
ps: No user named 'xww'

Which is because of:
$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin';
$LINUX = $^O eq 'linux';
$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef";

How to repeat:
run mysql_zap with any arg

Suggested fix:
Place darwin into linux instead, like this:

$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4";
$LINUX = $^O eq 'linux' || $^O eq 'darwin';
$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef";

That will fix it:

~/5.1.30/bin:08:51:10:Qalbi $ ./mysql_zap 5075
USER       PID %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
westerlund 30530   0.0  0.8   634068  16060   ??  S    Wed12AM   5:12.39 /5075/libexec/mysqld --basedir=/5075 --datadir=/5075/var/ --user=mysql --pid-file=/5075/var/Qalbi.local.pid? y
kill -15
westerlund 30507   0.0  0.0   600252    164   ??  S    Wed12AM   0:00.01 /bin/sh /5075/bin/mysqld_safe --datadir=/5075/var --pid-file=/5075/var/Qalbi.local.pid --datadir=/5075/var/? y
kill -15
westerlund 55436   0.0  0.0    76212    168 s010  S+   Tue02AM   0:00.04 /5075/bin/mysql -uroot? y
kill -15
westerlund 44240   0.0  0.0    76212    168 s002  S+   Tue01AM   0:00.04 /5075/bin/mysql -uroot? y
kill -15
[11 Jan 2009 12:29] Sveta Smirnova
Thank you for the report.

Verified as described.
[8 May 2009 0:55] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/73627

2892 Jim Winstead	2009-05-07
      The arguments to use for ps on Mac OS X were mis-detected by the mysql_zap
      utility. (Bug #41883, patch by Nicklas Westerlund)
      modified:
        scripts/mysql_zap.sh
[13 May 2009 16:07] Jim Winstead
Patch queued to 5.1-bugteam, will be merged up from there.
[28 May 2009 8:15] Bugs System
Pushed into 5.1.36 (revid:joro@sun.com-20090528073639-yohsb4q1jzg7ycws) (version source revid:jimw@mysql.com-20090512212719-mjc8fz4q3ewvr4yd) (merge vers: 5.1.35) (pib:6)
[1 Jun 2009 19:15] Paul Dubois
Noted in 5.1.36 changelog.

mysql_zap did not work on Mac OS X.  

Setting report to NDI pending push into 6.0.x.
[17 Jun 2009 19:21] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090616183122-chjzbaa30qopdra9) (version source revid:jimw@mysql.com-20090514020104-7u5cqf5cyywa8aks) (merge vers: 6.0.12-alpha) (pib:11)
[25 Jun 2009 2:25] Paul Dubois
Noted in 5.4.4 changelog.

Cosmetic change. No changelog entry needed.
[12 Aug 2009 22:47] Paul Dubois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.

Ignore the "cosmetic change" remark in the previous comment.
[15 Aug 2009 2:02] Paul Dubois
Ignore previous comment about 5.4.2.
[26 Aug 2009 13:45] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:32] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[8 Oct 2009 19:35] Paul Dubois
The 5.4 fix has been pushed to 5.4.2.