Skip to content

Force search /usr/sbin for mysqld#5506

Merged
morgo merged 1 commit intovitessio:masterfrom
planetscale:morgo-fix-sbin
Dec 10, 2019
Merged

Force search /usr/sbin for mysqld#5506
morgo merged 1 commit intovitessio:masterfrom
planetscale:morgo-fix-sbin

Conversation

@morgo
Copy link
Copy Markdown
Contributor

@morgo morgo commented Dec 4, 2019

This is not the most elegant patch, but it's quite possible that a user's PATH does not include /usr/sbin. This is the default location for mysqld, and we don't strictly need to be a super-user to run it, because we use different directories and ports to the default.


I manually tested this on an Ubuntu 19.10 VM by removing /sbin and /usr/sbin from PATH, and it was able to run the local example.

This issue was reported by Emi & @PrismaPhonic. It is technically a regression of #5488 which removed the following lines from dev.env:

# mysql install location. Please set based on your environment.
# Build will not work if this is incorrect.

if [[ "$VT_MYSQL_ROOT" == "" ]]; then
  if [[ "$(which mysql)" == "" ]]; then
     echo "WARNING: VT_MYSQL_ROOT unset because mysql not found. Did you install a client package?"
  else
    VT_MYSQL_ROOT=$(dirname "$(dirname "$(which mysql)")")
    export VT_MYSQL_ROOT
  fi
fi

Technically this was looking at the path for the mysql client though, and did not guarantee that the server package was installed. It is the server package which is needed, so overall this is an improvement, but longer term there should be a dependency-check. I am working on one in #5382 but it will take some time to complete before merging.

Signed-off-by: Morgan Tocker tocker@gmail.com

Signed-off-by: Morgan Tocker <tocker@gmail.com>
@morgo morgo requested a review from sougou as a code owner December 4, 2019 20:07
@morgo morgo merged commit f517d52 into vitessio:master Dec 10, 2019
@morgo morgo deleted the morgo-fix-sbin branch December 10, 2019 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants