mysql.server formula fixes for gentoo

mysql.server formula failed on gentoo because of hard-coded pid-file (pid_file is not detected as declared for gentoo defaults.yaml because the variable name for the pid-file is hard-coded in the init.d script installed by standard dev-db/mysql ebuild as pid-file (not pid_file)).
mysql.server formula also failed because it was missing the  step. This commit adds this as an alternative mysql_initialize step for the gentoo os_family.
This commit is contained in:
Sarah Rose 2016-12-09 15:32:24 +01:00
parent c809d5f59b
commit c371ff7f14
2 changed files with 13 additions and 2 deletions

View file

@ -327,7 +327,8 @@ Gentoo:
user: mysql
port: 3306
socket: /var/run/mysqld/mysqld.sock
pid_file: /var/run/mysqld/mysqld.pid
# note: on gentoo the init.d script specifically relies on the variable called pid-file, so don't use the underscore
pid-file: /var/run/mysqld/mysqld.pid
log_error: /var/log/mysql/mysqld.err
basedir: /usr
datadir: /var/lib/mysql

View file

@ -100,13 +100,23 @@ mysql_initialize:
- pkg: {{ mysql.server }}
{% endif %}
{% if os_family in ['Gentoo'] %}
mysql_initialize:
cmd.run:
- name: emerge --config {{ mysql.server }}
- user: root
- creates: {{ mysql_datadir}}/mysql/
- require:
- pkg: {{ mysql.server }}
{% endif %}
mysqld:
service.running:
- name: {{ mysql.service }}
- enable: True
- require:
- pkg: {{ mysql.server }}
{% if os_family in ['RedHat', 'Suse'] and mysql.version is defined and mysql.version >= 5.7 %}
{% if (os_family in ['RedHat', 'Suse'] and mysql.version is defined and mysql.version >= 5.7) or (os_family in ['Gentoo']) %}
- cmd: mysql_initialize
{% endif %}
- watch: