Skip to content

Conversation

tianon
Copy link
Member

@tianon tianon commented Aug 4, 2015

This also cleans up some minor unnecessary bits in docker-entrypoint.sh so that it's more consistent.

Compare to https://github.com/docker-library/postgres/blob/a82c28e1c407ef5ddfc2a6014dac87bcc4955a26/docker-entrypoint.sh#L49-L97

Fixes #24
Closes #87 (implements what was additionally discussed there)

@tianon
Copy link
Member Author

tianon commented Aug 4, 2015

Copy link
Member Author

Choose a reason for hiding this comment

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

By using $! instead of parsing the mysqld config, we can guarantee that the process is a child of our shell and thus we can wait on it during shutdown (see below) instead of looping while we wait for it to die.

… implementation This also cleans up some minor unnecessary bits in `docker-entrypoint.sh` so that it's more consistent. Compare to https://github.com/docker-library/postgres/blob/a82c28e1c407ef5ddfc2a6014dac87bcc4955a26/docker-entrypoint.sh#L49-L97
@tianon tianon force-pushed the docker-entrypoint-initdb.d branch from 55fa7a5 to 14f1655 Compare August 4, 2015 23:10
@yosifkit
Copy link
Member

yosifkit commented Aug 5, 2015

LGTM

yosifkit added a commit that referenced this pull request Aug 6, 2015
Add support for "/docker-entrypoint-initdb.d" similar to PostgreSQL's implementation
@yosifkit yosifkit merged commit a5fe2ca into docker-library:master Aug 6, 2015
@yosifkit yosifkit deleted the docker-entrypoint-initdb.d branch August 6, 2015 23:45
@funkyfuture
Copy link

Are there docs on this functionality?

@yosifkit
Copy link
Member

yosifkit commented Aug 7, 2015

Looks like we forgot to do that. it should be fairly similar to the one for postgres: https://hub.docker.com/_/postgres/#how-to-extend-this-image

@ltangvald
Copy link
Collaborator

Very nice! The upcoming http://dev.mysql.com/doc/refman/5.7/en/shutdown.html might help clean up the entrypoint script further.

@thaJeztah
Copy link

Thanks @ltangvald! And thanks @tianon I think this could make many people happy

@funkyfuture
Copy link

here's one: 💃

@tianon
Copy link
Member Author

tianon commented Aug 11, 2015

@ltangvald oh interesting -- I'll bet we could just use mysqladmin directly right now, couldn't we?

@ltangvald
Copy link
Collaborator

No, unfortunately I got a bit too excited about it :)
mysqladmin shutdown will send a shutdown signal, but won't wait for a complete server shutdown.
So the SHUTDOWN statement won't be very useful as it is now. We'd need to put everything into a single init-file with the syntax constraints that imply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants