-
Notifications
You must be signed in to change notification settings - Fork 25
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
[Improvement] Add port checks for MySQL and Postgres #22
base: main
Are you sure you want to change the base?
Conversation
Think twice. The shell shouldn't take effect. The shell of |
Ah, yes, you are right. This doesn't fix the issue; I'll pull the script out and place them in the launch script. |
echo "Checking if MySQL is runing" | ||
if lsof -Pi :3306 -sTCP:LISTEN -t >/dev/null ; then | ||
echo "MySQL may allready be running on port 3306. Please shut down MySQL before launching the playground." | ||
exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to exit with code -1, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so other existing exit in the script doesn't exit with -1
Is the scrip ok for both mac and linux? |
Yep see https://manpages.ubuntu.com/manpages/bionic/en/man8/lsof.8.html |
echo "Checking if Postgres is runing" | ||
if lsof -Pi :5432 -sTCP:LISTEN -t >/dev/null ; then | ||
echo "Postgres may allready be running on port 5432. Please shut down Postgres before launching the playground." | ||
exit -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we exit with code -1
here?
This is something similar as #60, I propose to solve that by chaning to an less possible conflict port in local, which is common used in docker deployments. |
Hi Justin, I have changed the playground to use non-default ports to avoid such conflicts, see: fd68dd2 So I think this PR is not needed; If user still got conflict (the possibility is very low), he can modify the yaml. |
Add scripts to check if ports are in use and that means the user is likely running MySQl or Posgres locally. I assume for this scripts to run new MySQL and Postgres docker images will need to be made. I tested the scripts manually and they detected if the port was in use.