Skip to content

More comprehensive logs during mysql initialization #385

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions 5.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" )

for i in {30..0}; do
if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then
echo 'Trying to connect to mysql...'
if echo 'SELECT 1' | "${mysql[@]}" > /dev/null; then
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stderr can be very useful sometimes. We should not always suppress it. So here I removed the '&'.

break
fi
echo 'MySQL init process in progress...'
echo 'MySQL init process must be in progress...'
sleep 1
done
if [ "$i" = 0 ]; then
Expand Down
5 changes: 3 additions & 2 deletions 5.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" )

for i in {30..0}; do
if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then
echo 'Trying to connect to mysql...'
if echo 'SELECT 1' | "${mysql[@]}" > /dev/null; then
break
fi
echo 'MySQL init process in progress...'
echo 'MySQL init process must be in progress...'
sleep 1
done
if [ "$i" = 0 ]; then
Expand Down
5 changes: 3 additions & 2 deletions 5.7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" )

for i in {30..0}; do
if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then
echo 'Trying to connect to mysql...'
if echo 'SELECT 1' | "${mysql[@]}" > /dev/null; then
break
fi
echo 'MySQL init process in progress...'
echo 'MySQL init process must be in progress...'
sleep 1
done
if [ "$i" = 0 ]; then
Expand Down