Bug #51502 building with cmake creates an invalid mysqld_safe
Submitted: 25 Feb 2010 13:20 Modified: 6 Mar 2010 19:48
Reporter: Giuseppe Maxia Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:5.5.99-m3 OS:MacOS
Assigned to: Vladislav Vaintroub CPU Architecture:Any

[25 Feb 2010 13:20] Giuseppe Maxia
Description:
Compiled the server in two ways.
(1) ./BUILD/autorun.sh && configure && make
(2) ./BUILD/compile-dist && make dist, expanded the source tarball and ran ./configure && make

In both cases, the mysqld_safe script is faulty. See line 661 below:

656 if test -f "$pid_file"
657 then
658   PID=`cat "$pid_file"`
659   if kill -s SIGCONT $PID  > /dev/null 2> /dev/null
660   then
661     if 
662     then    # The pid contains a mysqld process
663       log_error "A mysqld process already exists"
664       exit 1
665     fi
666   fi
667   rm -f "$pid_file"
668   if test -f "$pid_file"
669   then
670     log_error "Fatal error: Can't remove the pid file:
671 $pid_file
672 Please remove it manually and start $0 again;
673 mysqld daemon not started"
674     exit 1
675   fi
676 fi

How to repeat:
see above
[25 Feb 2010 20:38] 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/101530

2989 Vladislav Vaintroub	2010-02-25
      Bug#51502: building with cmake creates an invalid mysqld_safe.
      
      The problem was incorrect espaping used inside a strig : in \"$MYSQLD\" was written as "\MYSQL\" 
      (backslash and quote characters transposed), when defining FIND_PROC  variable for BSD or SysV
      style "ps".
      
      Additionally fixed obvious code duplication and random naming in CHECK_PID test.
[25 Feb 2010 20:40] 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/101531

2989 Vladislav Vaintroub	2010-02-25
      Bug#51502: building with cmake creates an invalid mysqld_safe.
      
      The problem was incorrect escaping used inside a strnig : in \"$MYSQLD\" was written as "\MYSQL\" 
      (backslash and quote characters transposed), when defining FIND_PROC  variable for BSD or SysV
      style "ps" command-
      
      Additionally fixed obvious code duplication and random naming in CHECK_PID test.
[26 Feb 2010 0:10] Vladislav Vaintroub
pushed to next-mr-bugfixing, 6.0-codebase-bugfixing
[26 Feb 2010 0:24] Vladislav Vaintroub
pushed to next-mr-bugfixing, 6.0-codebase-bugfixing
[2 Mar 2010 23:08] Giuseppe Maxia
See also Bug#51661 no test for mysqld_safe in the test suite
[6 Mar 2010 10:29] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100306102742-yw9zzgw9ac5r65m5) (version source revid:bar@mysql.com-20100305074327-h09o5lw290s04lcf) (merge vers: 6.0.14-alpha) (pib:16)
[6 Mar 2010 10:31] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100306102638-qna09hbjb5gm940h) (version source revid:alik@sun.com-20100304153932-9hajxhhyanqbckmu) (pib:16)
[6 Mar 2010 10:57] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:alik@sun.com-20100304153932-9hajxhhyanqbckmu) (merge vers: 5.5.99-m3) (pib:16)
[6 Mar 2010 19:48] Paul DuBois
Appears in no released version. No changelog entry needed.