Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force search /usr/sbin for mysqld #5506

Merged
merged 1 commit into from
Dec 10, 2019
Merged

Conversation

morgo
Copy link
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 [email protected]

@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
systay pushed a commit that referenced this pull request Jul 22, 2024
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