Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#13647 closed defect (worksforme)

mysql5 startup script is broken due to non-standard default command names

Reported by: chris@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc:
Port:

Description

mysql5 installs all of its binaries with a trailing -5 syntax. Besides being extremely annoying this breaks the provided startup script:

 chris@Enceladus:/opt/local/bin $ grep /mysqld_safe /opt/local/share/mysql5/mysql/mysql.server
 elif test -x $bindir/mysqld_safe
 $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &

This could be fixed by editing that script but I chose to correctthe binary names instead so my personal scripts, aliases, text editors, etc. don't also have to be updated:

chris@Enceladus:/opt/local/bin $ for f in my*5; do sudo mv "$f" "`echo $f | sed 's/5$//'`"; done

Change History (6)

comment:1 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…

comment:2 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: invalid
Status: newclosed

The mysql.server script should work correctly. The $bindir referenced in the script is /opt/local/lib/mysql5/bin; if you look into that directory, you will find the binaries without the "5" suffix.

However, you are not supposed to use the mysql.server script directly. Instead, you're expected to use "sudo port load mysql5" and "sudo port unload mysql5" to start and stop the server, respectively.

If you believe the mysql.server script truly is broken, then please reopen this ticket and paste in the error message you receive.

comment:3 Changed 17 years ago by chris@…

Resolution: invalid
Status: closedreopened

It's also used by the launchd script users are encouraged to use at the end of the port install process; I only noticed any of this because mysql.server failed after a fresh install and launchctl load.

It looks like the underlying problem was my.cnf having "basedir = /opt/local" but not having bindir set to /opt/local/lib/mysql5/bin - it defaults to $basedir/bin and that's broken by the non-standard binary names. If you'd prefer I'll open a new ticket requesting that MacPorts follow the standard naming convention to avoid breaking scripts.

comment:4 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Sounds like an incorrect configuration of your my.cnf then.

What change to the mysql5 portfile do you propose?

comment:5 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: worksforme
Status: reopenedclosed

No response -> closing. Please reopen if you still have a suggestion about what should be changed in the portfile.

comment:6 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.