Opened 7 years ago

Last modified 21 months ago

#40018 assigned defect

Error in mysqld_safe script prevents startup

Reported by: modemmonkey@… Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: Cc: parzley@…
Port: percona

Description

In the most recent version of the percona port (percona @5.5.32-31.0_0), there is a bug in the mysqld_safe script that prevents MySQL from starting up. Upon running it, it gives the following error:

/opt/local/lib/percona/bin/mysqld_safe: line 734: syntax error near unexpected token `then'
/opt/local/lib/percona/bin/mysqld_safe: line 734: `    then    # The pid contains a mysqld process'

Looking into the script, there is an IF statement on line 733 that has no condition, and I'm assuming that's the issue. I've worked around this by re-activating a previous version of the port, but it's going to be a pain for users who are installing it for the first time.

Change History (8)

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to quest@…
Priority: HighNormal

In the future, please Cc the port maintainer(s) and do not set the Priority field.

comment:2 Changed 7 years ago by pcollinson

I've changed the code in mysqld_safe at line 723 from

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
    fi
  fi

to

  if kill -0 $PID > /dev/null 2> /dev/null
  then
    if ps -ef | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null
    then    # The pid contains a mysqld process                                 
      log_error "A mysqld process already exists"
      exit 1
    fi
  fi

The ps line was taken from the previous release.

Last edited 7 years ago by pcollinson (previous) (diff)

comment:3 Changed 7 years ago by pixilla (Bradley Giesbrecht)

Cc: pixilla@… added

Cc Me!

comment:4 Changed 7 years ago by parzley@…

I get the same for mysql55-server @5.5.33:

/opt/local/lib/mysql55/bin/mysqld_safe: line 726: syntax error near unexpected token `then'
/opt/local/lib/mysql55/bin/mysqld_safe: line 726: `    then    # The pid contains a mysqld process'

and with mariadb-server @5.5.32

/opt/local/lib/mariadb/bin/mysqld_safe: line 748: syntax error near unexpected token `then'
/opt/local/lib/mariadb/bin/mysqld_safe: line 748: `    then    # The pid contains a mysqld process'

comment:5 Changed 7 years ago by parzley@…

Cc: parzley@… added

Cc Me!

comment:6 Changed 4 years ago by kurthindenburg (Kurt Hindenburg)

Owner: changed from quest@… to macports-tickets@…
Status: newassigned

comment:7 Changed 4 years ago by pixilla (Bradley Giesbrecht)

Cc: pixilla removed
Owner: changed from macports-tickets@… to pixilla

comment:8 Changed 21 months ago by mf2k (Frank Schima)

Owner: pixilla deleted

See #57827

Note: See TracTickets for help on using tickets.