[MacPorts] #61267: mysql8: mysqld_safe: line 810: syntax error near unexpected token `then' (was: Error in mysqld_safe from mysql8-server)

MacPorts noreply at macports.org
Sun Oct 4 20:22:19 UTC 2020


#61267: mysql8: mysqld_safe: line 810: syntax error near unexpected token `then'
----------------------------+-------------------------
  Reporter:  murrayE        |      Owner:  herbygillot
      Type:  defect         |     Status:  assigned
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:  2.6.3
Resolution:                 |   Keywords:
      Port:  mysql8-server  |
----------------------------+-------------------------

Comment (by ryandesign):

 I agree, there is a syntax error in mysqld_safe. Line 802 through 812 are:

 {{{
 # If there exists an old pid file, check if the daemon is already running
 # Note: The switches to 'ps' may depend on your operating system
 if test -f "$pid_file"
 then
   PID=`cat "$pid_file"`
   if kill -0 $PID > /dev/null 2> /dev/null
   then
     if
     then    # The pid contains a mysqld process
       log_error "A mysqld process already exists"
       exit 1
 }}}

 There should be something after that `if` on line 809.

 In the original source code, those lines in scripts/mysqld_safe.sh are:

 {{{
 # If there exists an old pid file, check if the daemon is already running
 # Note: The switches to 'ps' may depend on your operating system
 if test -f "$pid_file"
 then
   PID=`cat "$pid_file"`
   if @CHECK_PID@
   then
     if @FIND_PROC@
     then    # The pid contains a mysqld process
       log_error "A mysqld process already exists"
       exit 1
 }}}

 So evidently the placeholder `@FIND_PROC@` is getting replaced with the
 empty string, and should be getting replaced with something else instead.

-- 
Ticket URL: <https://trac.macports.org/ticket/61267#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list