Galera master installation hangs

Galera master installation hangs on installation
mysql-server-wsrep-5.6. It seems that log_error is not working,
because of next message: "mysqld_safe Can't log to error log and
syslog at the same time. Remove all --log-error configuration
options for --syslog to take effect." Using "syslog = yes" instead
of log_error makes it works without any other changes.

Change-Id: I39a8a87ed048557c19f3843b97c75469385e4978
Closes-bug: PROD-9065
diff --git a/galera/files/my.cnf b/galera/files/my.cnf
index 970e630..5ceb376 100644
--- a/galera/files/my.cnf
+++ b/galera/files/my.cnf
@@ -9,6 +9,8 @@
 {%- from "galera/map.jinja" import slave with context %}
 {%- set service = slave %}
 {%- endif %}
+[mysqld_safe]
+syslog
 
 [mysqld]
 datadir=/var/lib/mysql
@@ -21,7 +23,7 @@
 init-connect='SET NAMES utf8'
 character-set-server=utf8
 default-storage-engine=innodb
-log_error=/var/log/mysql/error.log
+#log_error=/var/log/mysql/error.log
 skip-external-locking
 skip-name-resolve
 
diff --git a/galera/files/my.cnf.init b/galera/files/my.cnf.init
index d3a1dec..ea0e0f0 100644
--- a/galera/files/my.cnf.init
+++ b/galera/files/my.cnf.init
@@ -9,7 +9,8 @@
 {%- from "galera/map.jinja" import slave with context %}
 {%- set service = slave %}
 {%- endif %}
-
+[mysqld_safe]
+syslog
 [mysqld]
 datadir=/var/lib/mysql
 bind-address={{ service.bind.address }}
@@ -21,7 +22,6 @@
 init-connect='SET NAMES utf8'
 character-set-server=utf8
 default-storage-engine=innodb
-
 skip-external-locking
 skip-name-resolve
 
diff --git a/galera/files/my.cnf.pre b/galera/files/my.cnf.pre
new file mode 100644
index 0000000..9bc6c17
--- /dev/null
+++ b/galera/files/my.cnf.pre
@@ -0,0 +1,36 @@
+[client]
+port		= 3306
+socket		= /var/run/mysqld/mysqld.sock
+[mysqld_safe]
+socket		= /var/run/mysqld/mysqld.sock
+nice		= 0
+syslog
+[mysqld]
+user		= mysql
+pid-file	= /var/run/mysqld/mysqld.pid
+socket		= /var/run/mysqld/mysqld.sock
+port		= 3306
+basedir		= /usr
+datadir		= /var/lib/mysql
+tmpdir		= /tmp
+lc-messages-dir	= /usr/share/mysql
+skip-external-locking
+bind-address		= 127.0.0.1
+key_buffer		= 16M
+max_allowed_packet	= 16M
+thread_stack		= 192K
+thread_cache_size       = 8
+myisam-recover         = BACKUP
+query_cache_limit	= 1M
+query_cache_size        = 16M
+#log_error = /var/log/mysql/error.log
+expire_logs_days	= 10
+max_binlog_size         = 100M
+[mysqldump]
+quick
+quote-names
+max_allowed_packet	= 16M
+[mysql]
+[isamchk]
+key_buffer		= 16M
+!includedir /etc/mysql/conf.d/
diff --git a/galera/master.sls b/galera/master.sls
index 6d230b4..32c16e2 100644
--- a/galera/master.sls
+++ b/galera/master.sls
@@ -95,6 +95,16 @@
 
 {%- if salt['cmd.run']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0'  %}
 
+# Enforce config before package installation
+galera_pre_config:
+  file.managed:
+  - name: {{ master.config }}
+  - source: salt://galera/files/my.cnf.pre
+  - mode: 644
+  - template: jinja
+  - require_in:
+    - pkg: galera_packages
+
 galera_init_start_service:
   cmd.run:
   - name: /usr/local/sbin/galera_init.sh
diff --git a/galera/slave.sls b/galera/slave.sls
index fb59f48..5ca72f8 100644
--- a/galera/slave.sls
+++ b/galera/slave.sls
@@ -95,6 +95,16 @@
 
 {%- if salt['cmd.run']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0'  %}
 
+# Enforce config before package installation
+galera_pre_config:
+  file.managed:
+  - name: {{ slave.config }}
+  - source: salt://galera/files/my.cnf.pre
+  - mode: 644
+  - template: jinja
+  - require_in:
+    - pkg: galera_packages
+
 galera_init_start_service:
   cmd.run:
   - name: /usr/local/sbin/galera_init.sh