Skip to content

Make get_option() handle duplicate options in my_print_defaults output #75

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

Merged
merged 1 commit into from
Jun 30, 2015
Merged

Make get_option() handle duplicate options in my_print_defaults output #75

merged 1 commit into from
Jun 30, 2015

Conversation

edmorley
Copy link
Contributor

get_option() was added by #53 to extract socket and pid-file from my_print_defaults. However if a custom mysql configuration file has been added, my_print_defaults returns duplicates (it merely lists all options specified in any config file and doesn't de-dupe). In these cases, ret would equal:
/var/run/mysqld/mysqld.sock /var/lib/mysql/mysqld.sock
...causing:
/entrypoint.sh: line 9: [: /var/run/mysqld/mysqld.sock: binary operator expected

As such, get_option() should just return the last matching option found in the my_print_defaults output - which should correspond to the one in the custom configuration file (rather than say the global default).

Fixes #74.

get_option() was added by #53 to extract `socket` and `pid-file` from
my_print_defaults. However if a custom mysql configuration file has been
added, my_print_defaults returns duplicates (it merely lists all options
specified in any config file and doesn't de-dupe). In these cases, `ret`
would equal `/var/run/mysqld/mysqld.sock /var/lib/mysql/mysql.sock`,
causing:
`/entrypoint.sh: line 9: [: /var/run/mysqld/mysqld.sock: binary operator expected`

As such, get_option() should just return the last matching option found
in the my_print_defaults output - which should correspond to the one in
the custom configuration file (rather than say the global default).

Fixes #74.
@edmorley
Copy link
Contributor Author

Travis is failing, however when I reverted my change for mysql:5.6, and pushed again, I got the same failure. In addition, the mysql:5.7 failure is a timeout during the build, which I can't see how is related to an entrypoint script change. As such, I believe the Travis runs are broken on master due to changes in https://github.com/docker-library/official-images or elsewhere.

I've filed #76 and #77 to track them separately.

@tianon
Copy link
Member

tianon commented Jun 30, 2015

LGTM

(and I'd personally be +1 for classifying this as a bug 👍)

tianon added a commit that referenced this pull request Jun 30, 2015
Make get_option() handle duplicate options in my_print_defaults output
@tianon tianon merged commit c361883 into docker-library:master Jun 30, 2015
@edmorley
Copy link
Contributor Author

edmorley commented Jul 2, 2015

Thanks! Will file a bug again mysql's my_print_defaults when I get a chance :-)

@edmorley edmorley deleted the fix-my_print_defaults-handling branch July 2, 2015 17:19
tianon added a commit to infosiftr/stackbrew that referenced this pull request Jul 2, 2015
- `drupal`: 8.0.0-beta12
- `kibana`: 4.1.1
- `logstash`: 1.5.2
- `mongo`: 3.1.5
- `mysql`: fix `my_print_defaults` duplication (docker-library/mysql#75)
- `percona`: 5.5.44-rel37.3-1.wheezy and 5.6.25-73.0-1.wheezy
- `php`: switch from bz2 to xz (docker-library/php#110)
- `pypy`: pip 7.1.0
- `python`: pip 7.1.0
- `rabbitmq`: simple support for alternate `default_vhost`, `default_user`, `default_pass` (docker-library/rabbitmq#28)
RichardScothern pushed a commit to RichardScothern/official-images that referenced this pull request Jun 14, 2016
- `drupal`: 8.0.0-beta12
- `kibana`: 4.1.1
- `logstash`: 1.5.2
- `mongo`: 3.1.5
- `mysql`: fix `my_print_defaults` duplication (docker-library/mysql#75)
- `percona`: 5.5.44-rel37.3-1.wheezy and 5.6.25-73.0-1.wheezy
- `php`: switch from bz2 to xz (docker-library/php#110)
- `pypy`: pip 7.1.0
- `python`: pip 7.1.0
- `rabbitmq`: simple support for alternate `default_vhost`, `default_user`, `default_pass` (docker-library/rabbitmq#28)
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