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

entrypoint fails on chown if there are readonly hidden files in the datadir #587

Closed
jeffbearer opened this issue Aug 30, 2019 · 2 comments
Closed
Labels
Request Request for image modification or feature

Comments

@jeffbearer
Copy link

If there are readonly elements in the datadir like a .snapshot directory from a storage server the entrypoint fails on the chown of the datadir since the script is running the the -e shell option.

It can be worked around with adding a || true to that line. or a more elegant solution may be desired.

chown -R mysql:mysql "$DATADIR" || true

@wglambert wglambert added the Request Request for image modification or feature label Sep 3, 2019
@wglambert
Copy link

mysql:5.7 and lower has an option for ignoring directories https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_ignore-db-dir

Similar to the lost+found issue #186

@yosifkit
Copy link
Member

yosifkit commented Sep 5, 2019

With a .snapshot directory, it seems that you don't hit the #186 problem since it is a "hidden" folder.

You could just skip the chown by setting a --user (compose: user:) to the (non-root) owner of the directory on the storage server.

Or you could use a subdirectory of your storage device so that .snapshot is next to the target of /var/lib/mysql rather than inside it.

@tianon tianon closed this as completed Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

4 participants